Merge branch 'bugfix-110-ClubSellings' into 'master'

Fix error 500 in club sellings

Closes #110

See merge request ae/Sith!289
This commit is contained in:
Ailé 2021-11-18 14:32:11 +00:00
commit 9177c9d4c2

View File

@ -410,8 +410,9 @@ class TzAwareDateTimeField(forms.DateTimeField):
if isinstance(value, str): if isinstance(value, str):
# convert it into a naive datetime (no timezone attached) # convert it into a naive datetime (no timezone attached)
value = parse_datetime(value) value = parse_datetime(value)
# attach it to the UTC timezone (so that to_current_timezone() # attach it to the UTC timezone (so that to_current_timezone()) if not None
# converts it to the local timezone) # converts it to the local timezone)
if value is not None:
value = timezone.make_aware(value, timezone.utc) value = timezone.make_aware(value, timezone.utc)
if isinstance(value, datetime.datetime): if isinstance(value, datetime.datetime):