mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
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:
commit
9177c9d4c2
@ -410,9 +410,10 @@ 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)
|
||||||
value = timezone.make_aware(value, timezone.utc)
|
if value is not None:
|
||||||
|
value = timezone.make_aware(value, timezone.utc)
|
||||||
|
|
||||||
if isinstance(value, datetime.datetime):
|
if isinstance(value, datetime.datetime):
|
||||||
value = to_current_timezone(value)
|
value = to_current_timezone(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user