Changeset - 1c239c361f00
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-09-13 03:20:02
chrisjrn@gmail.com
Propagates the per_user_limit category error to the products, rather than the category.

Fixes #79.
1 file changed with 5 insertions and 6 deletions:
0 comments (0 inline, 0 general)
registrasion/controllers/cart.py
Show inline comments
...
 
@@ -205,12 +205,11 @@ class CartController(object):
 
            to_add = sum(i[1] for i in by_cat[category])
 

	
 
            if to_add > limit:
 
                errors.append((
 
                    category,
 
                    "You may only have %d items in category: %s" % (
 
                        limit, category.name,
 
                    )
 
                ))
 
                message = "You may only have %d items in category: %s" % (
 
                    limit, category.name,
 
                )
 
                for product, quantity in by_cat[category]:
 
                    errors.append((product, message))
 

	
 
        # Test the flag conditions
 
        errs = FlagController.test_flags(
0 comments (0 inline, 0 general)