Presale: Hide subevent lists if subevents exist but none are visible (Z#23186153) (#5054)

* Hide subevent lists (but not calendars) if subevents exist but none are visible, to avoid confusion during checkout
This commit is contained in:
Phin Wolkwitz
2025-05-07 13:36:50 +02:00
committed by GitHub
parent f676a77536
commit 3e335bcbfe
2 changed files with 34 additions and 31 deletions

View File

@@ -815,6 +815,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
se for se in context['subevent_list']
if not se.presale_has_ended and (se.best_availability_state is None or se.best_availability_state >= Quota.AVAILABILITY_RESERVED)
]
context['visible_events'] = len(context['subevent_list']) > 0
return context