select_related order instead prefetch

This commit is contained in:
Richard Schreiber
2025-12-15 10:32:03 +01:00
parent 748897d258
commit 7a5ebd78bd

View File

@@ -656,7 +656,7 @@ def _redeem_process(*, checkinlists, raw_barcode, answers_data, datetime, force,
'list': MiniCheckinListSerializer(checkinlists[0]).data,
}, status=404)
op_candidates = []
for op in media.linked_orderpositions.all().prefetch_related("order"):
for op in media.linked_orderpositions.all().select_related("order"):
op_candidates.append(op)
if list_by_event[op.order.event_id].addon_match:
op_candidates += list(op.addons.all())