mirror of https://github.com/django/django.git
[3.0.x] Fixed #30802 -- Prevented manifest creation when running collectstatic in dry run mode.
Backport of fa8fe09e4e
from master
This commit is contained in:
parent
0c655f1df2
commit
5d63bf0bc3
|
@ -403,7 +403,8 @@ class ManifestFilesMixin(HashedFilesMixin):
|
||||||
def post_process(self, *args, **kwargs):
|
def post_process(self, *args, **kwargs):
|
||||||
self.hashed_files = {}
|
self.hashed_files = {}
|
||||||
yield from super().post_process(*args, **kwargs)
|
yield from super().post_process(*args, **kwargs)
|
||||||
self.save_manifest()
|
if not kwargs.get('dry_run'):
|
||||||
|
self.save_manifest()
|
||||||
|
|
||||||
def save_manifest(self):
|
def save_manifest(self):
|
||||||
payload = {'paths': self.hashed_files, 'version': self.manifest_version}
|
payload = {'paths': self.hashed_files, 'version': self.manifest_version}
|
||||||
|
|
|
@ -334,6 +334,11 @@ class TestCollectionDryRun(TestNoFilesCreated, CollectionTestCase):
|
||||||
super().run_collectstatic(dry_run=True)
|
super().run_collectstatic(dry_run=True)
|
||||||
|
|
||||||
|
|
||||||
|
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.ManifestStaticFilesStorage')
|
||||||
|
class TestCollectionDryRunManifestStaticFilesStorage(TestCollectionDryRun):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestCollectionFilesOverride(CollectionTestCase):
|
class TestCollectionFilesOverride(CollectionTestCase):
|
||||||
"""
|
"""
|
||||||
Test overriding duplicated files by ``collectstatic`` management command.
|
Test overriding duplicated files by ``collectstatic`` management command.
|
||||||
|
|
Loading…
Reference in New Issue