From 217018e1ef0098bacbeb24e361419bc499e82498 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Sun, 20 Mar 2022 15:46:36 -0400 Subject: [PATCH] Switch STATICFILES_STORAGE, to work around a bug with drf-yasg --- composed_configuration/_configuration.py | 5 ----- composed_configuration/_static.py | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/composed_configuration/_configuration.py b/composed_configuration/_configuration.py index 2505911..a00d902 100644 --- a/composed_configuration/_configuration.py +++ b/composed_configuration/_configuration.py @@ -72,11 +72,6 @@ class TestingBaseConfiguration(MinioStorageMixin, _BaseConfiguration): MINIO_STORAGE_MEDIA_BUCKET_NAME = 'test-django-storage' - # To generate static file URLs in testing (where DEBUG is False), - # CompressedManifestStaticFilesStorage requires collectstatic to be run, - # so use an alternative which does not require that - STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage' - # Testing will set EMAIL_BACKEND to use the memory backend diff --git a/composed_configuration/_static.py b/composed_configuration/_static.py index 0f99f58..bec0dc2 100644 --- a/composed_configuration/_static.py +++ b/composed_configuration/_static.py @@ -72,4 +72,6 @@ def mutate_configuration(configuration: Type[ComposedConfiguration]) -> None: security_index + 1, 'whitenoise.middleware.WhiteNoiseMiddleware' ) - STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' + # CompressedManifestStaticFilesStorage does not work properly with drf- + # https://github.com/axnsan12/drf-yasg/issues/761 + STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'