Seating: Set subevents to None if event has no subevents for _seat_allowed annotation (Z#23243880) (#6487)

This commit is contained in:
Martin Gross
2026-08-19 14:12:05 +02:00
committed by GitHub
parent 4969c12c0a
commit 91a3993cef
+4 -1
View File
@@ -2008,7 +2008,10 @@ class OrderChange(OrderView):
'issued_gift_cards',
'addons',
).annotate(
_seat_allowed=Exists(SeatCategoryMapping.objects.filter(subevent=OuterRef("subevent"), product=OuterRef("item")))
_seat_allowed=Exists(SeatCategoryMapping.objects.filter(
subevent=OuterRef("subevent") if self.request.event.has_subevents else None,
product=OuterRef("item"))
)
))
for p in positions:
p.form = OrderPositionChangeForm(