From d2fae2480ab01821275fbc2e1d806ab4afd503a2 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sat, 14 May 2016 16:32:42 +0200 Subject: [PATCH] pk not id --- shop/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop/views.py b/shop/views.py index 41bf9077..9a6317a4 100644 --- a/shop/views.py +++ b/shop/views.py @@ -29,7 +29,7 @@ class ProductDetailView(LoginRequiredMixin, FormView): context_object_name = 'product' def get(self, request, *args, **kwargs): - self.product = Product.objects.get(id=kwargs.get('product_id')) + self.product = Product.objects.get(pk=kwargs.get('pk')) def form_valid(self, form): ### do we have an open order?