mirror of
https://github.com/pretix/pretix.git
synced 2026-05-18 17:24:03 +00:00
simplify filter instead of annotate/get
This commit is contained in:
@@ -521,13 +521,12 @@ def _redeem_process(*, checkinlists, raw_barcode, answers_data, datetime, force,
|
|||||||
# with respecting the force option), or it's a reusable medium (-> proceed with that)
|
# with respecting the force option), or it's a reusable medium (-> proceed with that)
|
||||||
if not op_candidates:
|
if not op_candidates:
|
||||||
try:
|
try:
|
||||||
media = ReusableMedium.objects.active().annotate(
|
media = ReusableMedium.objects.active().filter(
|
||||||
has_linked_orderpositions=Exists(ReusableMedium.linked_orderpositions.through.objects.filter(reusablemedium_id=OuterRef('pk')))
|
Exists(ReusableMedium.linked_orderpositions.through.objects.filter(reusablemedium_id=OuterRef('pk')))
|
||||||
).get(
|
).get(
|
||||||
organizer_id=checkinlists[0].event.organizer_id,
|
organizer_id=checkinlists[0].event.organizer_id,
|
||||||
type=source_type,
|
type=source_type,
|
||||||
identifier=raw_barcode,
|
identifier=raw_barcode,
|
||||||
has_linked_orderpositions=True,
|
|
||||||
)
|
)
|
||||||
raw_barcode_for_checkin = raw_barcode
|
raw_barcode_for_checkin = raw_barcode
|
||||||
except ReusableMedium.DoesNotExist:
|
except ReusableMedium.DoesNotExist:
|
||||||
|
|||||||
Reference in New Issue
Block a user