Propagates the per_user_limit category error to the products, rather than the category.
Fixes #79.
This commit is contained in:
parent
3903d2be56
commit
1c239c361f
1 changed files with 5 additions and 6 deletions
|
@ -205,12 +205,11 @@ class CartController(object):
|
||||||
to_add = sum(i[1] for i in by_cat[category])
|
to_add = sum(i[1] for i in by_cat[category])
|
||||||
|
|
||||||
if to_add > limit:
|
if to_add > limit:
|
||||||
errors.append((
|
message = "You may only have %d items in category: %s" % (
|
||||||
category,
|
limit, category.name,
|
||||||
"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
|
# Test the flag conditions
|
||||||
errs = FlagController.test_flags(
|
errs = FlagController.test_flags(
|
||||||
|
|
Loading…
Reference in a new issue