forked from CGM_Public/pretix_original
Fix voucher validation in CartManager
This commit is contained in:
@@ -225,7 +225,10 @@ class CartManager:
|
|||||||
|
|
||||||
def _check_item_constraints(self, op):
|
def _check_item_constraints(self, op):
|
||||||
if isinstance(op, self.AddOperation) or isinstance(op, self.ExtendOperation):
|
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'])
|
raise CartError(error_messages['voucher_required'])
|
||||||
|
|
||||||
if not op.item.is_available() or (op.variation and not op.variation.active):
|
if not op.item.is_available() or (op.variation and not op.variation.active):
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</h2>
|
</h2>
|
||||||
{% if order.status == "n" and not order.require_approval %}
|
{% if order.status == "n" and not order.require_approval %}
|
||||||
<div class="panel panel-danger">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">
|
<h3 class="panel-title">
|
||||||
{% trans "Payment" %}
|
{% trans "Payment" %}
|
||||||
|
|||||||
Reference in New Issue
Block a user