mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Clean up timezone handling in calendar
This commit is contained in:
@@ -481,9 +481,9 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
|
||||
data['date'] = date(self.year, self.month, 1)
|
||||
if hasattr(self.request, 'event'):
|
||||
tz = pytz.timezone(self.request.event.settings.timezone)
|
||||
tz = self.request.event.timezone
|
||||
else:
|
||||
tz = pytz.UTC
|
||||
tz = self.request.organizer.timezone
|
||||
before = datetime(self.year, self.month, 1, 0, 0, 0, tzinfo=tz) - timedelta(days=1)
|
||||
after = datetime(self.year, self.month, ndays, 0, 0, 0, tzinfo=tz) + timedelta(days=1)
|
||||
|
||||
@@ -529,9 +529,9 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
self._set_week_year()
|
||||
|
||||
if hasattr(self.request, 'event'):
|
||||
tz = pytz.timezone(self.request.event.settings.timezone)
|
||||
tz = self.request.event.timezone
|
||||
else:
|
||||
tz = pytz.UTC
|
||||
tz = self.request.organizer.timezone
|
||||
|
||||
week = isoweek.Week(self.year, self.week)
|
||||
data['week'] = [self.year, self.week]
|
||||
@@ -583,7 +583,7 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
data['has_more_events'] = True
|
||||
evs = evs[:limit]
|
||||
|
||||
tz = pytz.timezone(request.event.settings.timezone)
|
||||
tz = request.event.timezone
|
||||
if self.request.event.settings.event_list_available_only:
|
||||
evs = [
|
||||
se for se in evs
|
||||
|
||||
Reference in New Issue
Block a user