From 2658c2ccde510fc8ea82e3b905b64f931bf23029 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Tue, 13 Sep 2016 13:33:20 +1000 Subject: [PATCH] Improves the error message when per_user_limit on category is breached. Fixes #80 --- registrasion/controllers/cart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registrasion/controllers/cart.py b/registrasion/controllers/cart.py index 3e417f1a..ad4458ea 100644 --- a/registrasion/controllers/cart.py +++ b/registrasion/controllers/cart.py @@ -205,7 +205,8 @@ class CartController(object): to_add = sum(i[1] for i in by_cat[category]) if to_add > limit: - message = "You may only have %d items in category: %s" % ( + message_base = "You may only add %d items from category: %s" + message = message_base % ( limit, category.name, ) for product, quantity in by_cat[category]: