diff --git a/registrasion/controllers/cart.py b/registrasion/controllers/cart.py index dbf7e8a061fa59c2c83990c6ee9ea83afe65d7a8..2ff9f171d8ce7c5d97db4fe2a5327e88bfc31186 100644 --- a/registrasion/controllers/cart.py +++ b/registrasion/controllers/cart.py @@ -217,16 +217,14 @@ class CartController(object): errors = [] # Pre-annotate products - products = [p for (p, q) in product_quantities] - r = ProductController.attach_user_remainders(self.cart.user, products) - with_remainders = dict((p, p) for p in r) + remainders = ProductController.user_remainders(self.cart.user) # Test each product limit here for product, quantity in product_quantities: if quantity < 0: errors.append((product, "Value must be zero or greater.")) - limit = with_remainders[product].remainder + limit = remainders[product.id] if quantity > limit: errors.append((