Skip to content

Commit 32b2590

Browse files
committed
Fix AttributeError
1 parent e4bdc35 commit 32b2590

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/vstorage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from os.path import join, getatime, getctime, getmtime
2-
from datetime import datetime
2+
from datetime import datetime, timezone
33
from io import StringIO
44

55
from django import VERSION as DJANGO_VERSION
@@ -14,7 +14,7 @@
1414
def datetime_from_timestamp(ts):
1515
# src: django.core.files.storage.FileSystemStorage._datetime_from_timestamp
1616
if settings.USE_TZ:
17-
return datetime.utcfromtimestamp(ts).replace(tzinfo=datetime.timezone.utc)
17+
return datetime.utcfromtimestamp(ts).replace(tzinfo=timezone.utc)
1818
return datetime.fromtimestamp(ts)
1919
else:
2020
datetime_from_timestamp = datetime.fromtimestamp
@@ -23,7 +23,7 @@ def datetime_from_timestamp(ts):
2323
class VirtualStorage(Storage):
2424
def __init__(self):
2525
map_ = settings.RENDERED_STATIC_FILES
26-
# RODO: raise configuration error
26+
# TODO: raise configuration error
2727
if isinstance(map_, dict):
2828
map_ = map_.items()
2929
self._map = {k: (v[0] if isinstance(v, (list, tuple)) else v) for k, v in map_}

0 commit comments

Comments
 (0)