forked from CGM_Public/pretix_original
Show better error message if a gift card is used in apply_voucher
This commit is contained in:
@@ -447,7 +447,10 @@ class CartManager:
|
|||||||
try:
|
try:
|
||||||
voucher = self.event.vouchers.get(code__iexact=voucher_code.strip())
|
voucher = self.event.vouchers.get(code__iexact=voucher_code.strip())
|
||||||
except Voucher.DoesNotExist:
|
except Voucher.DoesNotExist:
|
||||||
raise CartError(error_messages['voucher_invalid'])
|
if self.event.organizer.accepted_gift_cards.filter(secret__iexact=voucher_code).exists():
|
||||||
|
raise CartError(error_messages['gift_card'])
|
||||||
|
else:
|
||||||
|
raise CartError(error_messages['voucher_invalid'])
|
||||||
voucher_use_diff = Counter()
|
voucher_use_diff = Counter()
|
||||||
ops = []
|
ops = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user