From b85384b226a67f040c78aa34850aebf16d37a0e3 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Sat, 29 Dec 2018 23:55:18 +0100 Subject: [PATCH] Do not fail on empty discount --- cotisations/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cotisations/forms.py b/cotisations/forms.py index 73cb4971..56e90c58 100644 --- a/cotisations/forms.py +++ b/cotisations/forms.py @@ -133,7 +133,7 @@ class DiscountForm(Form): amount = discount/100 * invoice_price else: amount = discount - if amount > 0: + if amount: name = _("{}% discount") if is_relative else _("{}€ discount") name = name.format(discount) Vente.objects.create(