Merge pull request #23922 from regisb/regisb/fix-offset-naive-static-assets

Fix naive offset-naive/aware error in asset compilation [CRI-191]
This commit is contained in:
Ned Batchelder
2020-05-06 17:13:30 -04:00
committed by GitHub

View File

@@ -9,6 +9,7 @@ from django.contrib.staticfiles import utils
from django.contrib.staticfiles.finders import BaseFinder
from django.contrib.staticfiles.storage import FileSystemStorage
from django.core.files.storage import Storage
from django.utils import timezone
from pkg_resources import resource_exists, resource_filename, resource_isdir, resource_listdir
from xblock.core import XBlock
@@ -80,19 +81,19 @@ class XBlockPackageStorage(Storage):
"""
Returns a URL to the package resource.
"""
return datetime.fromtimestamp(os.path.getatime(self.path(name)))
return datetime.fromtimestamp(os.path.getatime(self.path(name)), timezone.utc)
def get_created_time(self, name):
"""
Returns the created time of the package resource.
"""
return datetime.fromtimestamp(os.path.getctime(self.path(name)))
return datetime.fromtimestamp(os.path.getctime(self.path(name)), timezone.utc)
def get_modified_time(self, name):
"""
Returns the modified time of the resource.
"""
return datetime.fromtimestamp(os.path.getmtime(self.path(name)))
return datetime.fromtimestamp(os.path.getmtime(self.path(name)), timezone.utc)
def url(self, name):
"""