Skip to content

Commit 93a59d1

Browse files
authored
Merge pull request #378 from edly-io/fix/default-file-storage-django42-compat
fix: check actual storage instance instead of removed DEFAULT_FILE_STORAGE setting
2 parents c15143a + 5ba4d96 commit 93a59d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

edx_sga/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import pytz
1111
from django.conf import settings
12+
from django.core.files.storage import FileSystemStorage
1213
from django.core.files.storage import default_storage as django_default_storage
1314
from django.core.files.storage import storages
1415
from django.utils.module_loading import import_string
@@ -85,8 +86,7 @@ def get_file_modified_time_utc(file_path):
8586
# time.tzname returns a 2 element tuple:
8687
# (local non-DST timezone, e.g.: 'EST', local DST timezone, e.g.: 'EDT')
8788
pytz.timezone(time.tzname[0])
88-
if settings.DEFAULT_FILE_STORAGE
89-
== "django.core.files.storage.FileSystemStorage"
89+
if isinstance(default_storage, FileSystemStorage)
9090
else pytz.utc
9191
)
9292

0 commit comments

Comments
 (0)