mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
add filter based on op.valid_from/until
This commit is contained in:
@@ -673,6 +673,17 @@ def _redeem_process(*, checkinlists, raw_barcode, answers_data, datetime, force,
|
||||
)
|
||||
]
|
||||
|
||||
if len(op_candidates_matching_product) > 1 :
|
||||
# if none of the above filters the results to 1, filter based on op.valid_from/until
|
||||
# keep ops without valid_from/until
|
||||
op_candidates_matching_product = [
|
||||
op for op in op_candidates_matching_product
|
||||
if (
|
||||
(not op.valid_from or op.valid_from < now()) and
|
||||
(not op.valid_until or op.valid_until > now())
|
||||
)
|
||||
]
|
||||
|
||||
if len(op_candidates_matching_product) == 0:
|
||||
# None of the found add-ons has the correct product, too bad! We could just error out here, but
|
||||
# instead we just continue with *any* product and have it rejected by the check in perform_checkin.
|
||||
|
||||
Reference in New Issue
Block a user