From 4456398735e14ab60d4959385db9c108a431cdef Mon Sep 17 00:00:00 2001 From: Sachi King Date: Wed, 5 Apr 2017 21:07:59 +1000 Subject: [PATCH] Price is not a relation and cannot select_related This field is ignored in 1.9, however in 1.10+ it is an error. As this is a no-op in 1.9, removal keeps functionality while extending compatability going forward. For full details please see Django Ticket 10414 at: https://code.djangoproject.com/ticket/10414 --- registrasion/controllers/cart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registrasion/controllers/cart.py b/registrasion/controllers/cart.py index c2249d77..8d67e5f0 100644 --- a/registrasion/controllers/cart.py +++ b/registrasion/controllers/cart.py @@ -445,7 +445,7 @@ class CartController(object): # Order the products such that the most expensive ones are # processed first. product_items = self.cart.productitem_set.all().select_related( - "product", "product__category", "product__price" + "product", "product__category" ).order_by("-product__price") products = [i.product for i in product_items]