forked from CGM_Public/pretix_original
Do not reset event list type automatically (Z#23226325) (#6068)
Co-authored-by: Kara Engelhardt <engelhardt@pretix.eu>
This commit is contained in:
@@ -681,8 +681,6 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
context = {}
|
||||
context['list_type'] = self.request.GET.get("style", self.request.event.settings.event_list_type)
|
||||
if context['list_type'] not in ("calendar", "week") and self.request.event.subevents.filter(date_from__gt=time_machine_now()).count() > 50:
|
||||
if self.request.event.settings.event_list_type not in ("calendar", "week"):
|
||||
self.request.event.settings.event_list_type = "calendar"
|
||||
context['list_type'] = "calendar"
|
||||
|
||||
if context['list_type'] == "calendar":
|
||||
|
||||
@@ -530,12 +530,10 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
]
|
||||
|
||||
if hasattr(self.request, 'event') and data['list_type'] not in ("calendar", "week"):
|
||||
# only allow list-view of more than 50 subevents if ordering is by data as this can be done in the database
|
||||
# only allow list-view of more than 50 subevents if ordering is by date as this can be done in the database
|
||||
# ordering by name is currently not supported in database due to I18NField-JSON
|
||||
ordering = self.request.event.settings.get('frontpage_subevent_ordering', default='date_ascending', as_type=str)
|
||||
if ordering not in ("date_ascending", "date_descending") and self.request.event.subevents.filter(date_from__gt=now()).count() > 50:
|
||||
if self.request.event.settings.event_list_type not in ("calendar", "week"):
|
||||
self.request.event.settings.event_list_type = "calendar"
|
||||
data['list_type'] = list_type = 'calendar'
|
||||
|
||||
if hasattr(self.request, 'event'):
|
||||
|
||||
Reference in New Issue
Block a user