Review notes

This commit is contained in:
Raphael Michel
2025-09-11 19:19:12 +02:00
parent b8f7aff5e4
commit 9c59206949
2 changed files with 12 additions and 3 deletions
+2 -2
View File
@@ -564,6 +564,8 @@ def add_events_for_days(request, baseqs, before, after, ebd, timezones):
def filter_subevents_with_plugins(subevents, sales_channel=None):
# Special-case of GlobalSignal.send_chained() that only sends subevents that have the plugin enabled
# and then mixes the results back together.
from pretix.base.signals import (
_populate_app_cache, app_cache, get_defining_app, is_app_active,
)
@@ -574,8 +576,6 @@ def filter_subevents_with_plugins(subevents, sales_channel=None):
if not app_cache:
_populate_app_cache()
# Special-case of GlobalSignal.send_chained() that only sends subevents that have the plugin enabled
# and then mixes the results back together.
for receiver in filter_subevents._live_receivers(None):
app = get_defining_app(receiver)
event_state = {}
+10 -1
View File
@@ -73,7 +73,8 @@ from pretix.presale.views.event import (
)
from pretix.presale.views.organizer import (
EventListMixin, add_events_for_days, add_subevents_for_days,
days_for_template, filter_qs_by_attr, weeks_for_template,
days_for_template, filter_qs_by_attr, filter_subevents_with_plugins,
weeks_for_template,
)
logger = logging.getLogger(__name__)
@@ -403,6 +404,14 @@ class WidgetAPIProductList(EventListMixin, View):
return self.response({
'error': gettext('The selected date does not exist in this event series.')
})
# Prevent direct access to subevents that are hidden by a plugin
subevents = filter_subevents_with_plugins([self.subevent], request.sales_channel)
if self.subevent not in subevents:
return self.response({
'error': gettext('The selected date is not available.')
})
else:
return self._get_event_list(request, **kwargs)
else: