From 2352f3b8117d4baf144ebdf1ef6ea7ee27db1195 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 8 Jul 2019 17:50:22 +0200 Subject: [PATCH] Fix voucher validation in CartManager --- src/pretix/base/services/cart.py | 5 ++++- src/pretix/presale/templates/pretixpresale/event/order.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pretix/base/services/cart.py b/src/pretix/base/services/cart.py index 770d29db9b..0167df425c 100644 --- a/src/pretix/base/services/cart.py +++ b/src/pretix/base/services/cart.py @@ -225,7 +225,10 @@ class CartManager: def _check_item_constraints(self, op): if isinstance(op, self.AddOperation) or isinstance(op, self.ExtendOperation): - if (op.item.require_voucher or op.item.hide_without_voucher) and (op.voucher is None or not op.voucher.show_hidden_items): + if op.item.require_voucher and op.voucher is None: + raise CartError(error_messages['voucher_required']) + + if op.item.hide_without_voucher and (op.voucher is None or not op.voucher.show_hidden_items): raise CartError(error_messages['voucher_required']) if not op.item.is_available() or (op.variation and not op.variation.active): diff --git a/src/pretix/presale/templates/pretixpresale/event/order.html b/src/pretix/presale/templates/pretixpresale/event/order.html index a59fde2e33..6a67c3ef7b 100644 --- a/src/pretix/presale/templates/pretixpresale/event/order.html +++ b/src/pretix/presale/templates/pretixpresale/event/order.html @@ -56,7 +56,7 @@
{% if order.status == "n" and not order.require_approval %} -
+

{% trans "Payment" %}