Add option to limit events to specific sales channels (#1867)

This commit is contained in:
Martin Gross
2020-12-03 17:10:54 +01:00
committed by GitHub
parent 55d8639ecc
commit b3e95f54dd
17 changed files with 185 additions and 23 deletions

View File

@@ -348,6 +348,9 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
r._csp_ignore = True
return r
if request.sales_channel.identifier not in request.event.sales_channels:
raise Http404(_('Tickets for this event cannot be purchased on this sales channel.'))
if request.event.has_subevents:
if 'subevent' in kwargs:
self.subevent = request.event.subevents.using(settings.DATABASE_REPLICA).filter(pk=kwargs['subevent'], active=True).first()