From 510fc14216e133ea8991fdbb173fa3917e6f1efc Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Mon, 15 Dec 2025 10:39:44 +0100 Subject: [PATCH] add filter based on op.valid_from/until --- src/pretix/api/views/checkin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pretix/api/views/checkin.py b/src/pretix/api/views/checkin.py index d6eba55088..d8d55c356d 100644 --- a/src/pretix/api/views/checkin.py +++ b/src/pretix/api/views/checkin.py @@ -672,6 +672,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.