mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
* Fix #489 -- Handle Vouchers With Unavailable Items * Add regression test
This commit is contained in:
committed by
Raphael Michel
parent
82d289cfcf
commit
764b9dda7e
@@ -395,6 +395,8 @@ class RedeemView(NoSearchIndexViewMixin, EventViewMixin, TemplateView):
|
||||
err = error_messages['voucher_redeemed']
|
||||
if self.voucher.valid_until is not None and self.voucher.valid_until < now():
|
||||
err = error_messages['voucher_expired']
|
||||
if self.voucher.item is not None and self.voucher.item.is_available() is False:
|
||||
err = error_messages['voucher_item_not_available']
|
||||
|
||||
redeemed_in_carts = CartPosition.objects.filter(
|
||||
Q(voucher=self.voucher) & Q(event=request.event) &
|
||||
|
||||
Reference in New Issue
Block a user