diff --git a/shop/views.py b/shop/views.py index 6a0b64b8..fc3d5f8b 100644 --- a/shop/views.py +++ b/shop/views.py @@ -40,7 +40,6 @@ class ProductDetailView(LoginRequiredMixin, FormView): order = Order.objects.create(user=request.user) ### get product from kwargs - product = Product.objects.get(id= if self.product in order.products.all(): ### this product is already added to this order, increase count by one OrderProductRelation.objects.filter(product=self.product, order=order).update(quantity=F('quantity') + 1)