Skip to content

Commit b7c1acc

Browse files
authored
Merge pull request #144 from kevinmarsh/feature/fix-datetime-import
Django 4.1: stop using Django's `utc` alias in favour of directly using `datetime.timezone.utc`
2 parents 5101f13 + b324663 commit b7c1acc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

django_s3_storage/storage.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import posixpath
88
import shutil
99
from contextlib import closing
10+
from datetime import timezone
1011
from functools import wraps
1112
from io import TextIOBase
1213
from tempfile import SpooledTemporaryFile
@@ -25,7 +26,7 @@
2526
from django.core.signals import setting_changed
2627
from django.utils.deconstruct import deconstructible
2728
from django.utils.encoding import filepath_to_uri, force_bytes, force_str
28-
from django.utils.timezone import make_naive, utc
29+
from django.utils.timezone import make_naive
2930

3031
log = logging.getLogger(__name__)
3132

@@ -449,7 +450,7 @@ def url(self, name, extra_params=None):
449450
return url
450451

451452
def modified_time(self, name):
452-
return make_naive(self.meta(name)["LastModified"], utc)
453+
return make_naive(self.meta(name)["LastModified"], timezone.utc)
453454

454455
created_time = accessed_time = modified_time
455456

0 commit comments

Comments
 (0)