mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Widget: Respect order_max of voucher (#5167)
* Widget: Respect order_max of voucher * fix tests, make voucher.max_usages explicit --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -293,6 +293,8 @@ def get_grouped_items(event, *, channel: SalesChannel, subevent=None, voucher=No
|
||||
max_per_order = sys.maxsize
|
||||
else:
|
||||
max_per_order = item.max_per_order or int(event.settings.max_items_per_order)
|
||||
if voucher:
|
||||
max_per_order = min(max_per_order, voucher.max_usages - voucher.redeemed)
|
||||
|
||||
if item.hidden_if_available:
|
||||
q = item.hidden_if_available.availability(_cache=quota_cache)
|
||||
|
||||
Reference in New Issue
Block a user