diff options
| author | Nathan Gaberel <nathan@gnab.fr> | 2019-05-22 09:07:55 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-03 13:11:55 +0200 |
| commit | b27c9c953bce3aed205ebc378350ef027ebdd25b (patch) | |
| tree | eb1e644c53f814d32e733fcb5be127c17259aa8d /django | |
| parent | 34ec52269ade54af31a021b12969913129571a3f (diff) | |
Fixed #28604 -- Prevented ManifestStaticFilesStorage from leaving intermediate files.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/storage.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py index 130d6270bb..a021bf46c5 100644 --- a/django/contrib/staticfiles/storage.py +++ b/django/contrib/staticfiles/storage.py @@ -55,6 +55,7 @@ class HashedFilesMixin: (r"""(@import\s*["']\s*(.*?)["'])""", """@import url("%s")"""), )), ) + keep_intermediate_files = True def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -297,8 +298,9 @@ class HashedFilesMixin: self.delete(hashed_name) # then save the processed result content_file = ContentFile(content.encode()) - # Save intermediate file for reference - saved_name = self._save(hashed_name, content_file) + if self.keep_intermediate_files: + # Save intermediate file for reference + self._save(hashed_name, content_file) hashed_name = self.hashed_name(name, content_file) if self.exists(hashed_name): @@ -370,6 +372,7 @@ class ManifestFilesMixin(HashedFilesMixin): manifest_version = '1.0' # the manifest format standard manifest_name = 'staticfiles.json' manifest_strict = True + keep_intermediate_files = False def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) |
