diff options
| author | Richard Campen <richard@campen.co> | 2020-04-27 08:19:22 +1200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-04-28 08:25:07 +0200 |
| commit | 67b334fbaf7cfb0936666ea788d406a55a09754c (patch) | |
| tree | c718dcec7c48df627c15fce6197435d2a8ec001d /django | |
| parent | 35f89d199c94ebc72b06d5c44077401aa2eae47f (diff) | |
Fixed #31517 -- Fixed HashedFilesMixin.hashed_name() if hash of the file is None.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/storage.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py index cc0f0f8e23..494890cc23 100644 --- a/django/contrib/staticfiles/storage.py +++ b/django/contrib/staticfiles/storage.py @@ -98,8 +98,7 @@ class HashedFilesMixin: content.close() path, filename = os.path.split(clean_name) root, ext = os.path.splitext(filename) - if file_hash is not None: - file_hash = ".%s" % file_hash + file_hash = ('.%s' % file_hash) if file_hash else '' hashed_name = os.path.join(path, "%s%s%s" % (root, file_hash, ext)) unparsed_name = list(parsed_name) |
