Revert "First steps into pytz deprecation"

This reverts commit e4e7d50659.
This commit is contained in:
Raphael Michel
2023-02-01 13:15:18 +01:00
parent e4e7d50659
commit 59d46ddded
63 changed files with 362 additions and 341 deletions

View File

@@ -22,6 +22,7 @@
import datetime
from urllib.parse import urlparse
import pytz
import vobject
from django.conf import settings
from django.utils.formats import date_format
@@ -40,11 +41,11 @@ def get_public_ical(events):
"""
cal = vobject.iCalendar()
cal.add('prodid').value = '-//pretix//{}//'.format(settings.PRETIX_INSTANCE_NAME.replace(" ", "_"))
creation_time = datetime.datetime.now(datetime.timezone.utc)
creation_time = datetime.datetime.now(pytz.utc)
for ev in events:
event = ev if isinstance(ev, Event) else ev.event
tz = event.timezone
tz = pytz.timezone(event.settings.timezone)
if isinstance(ev, Event):
url = build_absolute_uri(event, 'presale:event.index')
else:
@@ -112,9 +113,9 @@ def get_private_icals(event, positions):
- It would be pretty hard to implement it in a way that doesn't require us to use distinct
settings fields for emails to customers and to attendees, which feels like an overcomplication.
"""
tz = event.timezone
tz = pytz.timezone(event.settings.timezone)
creation_time = datetime.datetime.now(datetime.timezone.utc)
creation_time = datetime.datetime.now(pytz.utc)
calobjects = []
evs = set(p.subevent or event for p in positions)