Created
March 6, 2015 16:34
-
-
Save pmclanahan/d8546995539df6115d7e to your computer and use it in GitHub Desktop.
Django Patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py | |
index 6a0a540..61e22f6 100644 | |
--- a/django/contrib/staticfiles/storage.py | |
+++ b/django/contrib/staticfiles/storage.py | |
@@ -245,10 +245,13 @@ class HashedFilesMixin(object): | |
content = pattern.sub(converter, content) | |
except ValueError as exc: | |
yield name, None, exc | |
+ | |
+ content_file = ContentFile(force_bytes(content)) | |
+ # content likely changed, get new hashed_name | |
+ hashed_name = self.hashed_name(name, content_file) | |
if hashed_file_exists: | |
self.delete(hashed_name) | |
# then save the processed result | |
- content_file = ContentFile(force_bytes(content)) | |
saved_name = self._save(hashed_name, content_file) | |
hashed_name = force_text(self.clean_name(saved_name)) | |
processed = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment