From 9c6dd15a954e3d1b9b9fbc9ed437d391148e8f94 Mon Sep 17 00:00:00 2001 From: Dayo Ayeni Date: Wed, 18 Nov 2020 18:19:26 -0700 Subject: [PATCH] Allow customization of the setting name This update is a potential improvement to work around issues such as https://github.com/jazzband/django-pipeline/issues/734 --- pipeline/conf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipeline/conf.py b/pipeline/conf.py index b089ac14..b1534b3c 100644 --- a/pipeline/conf.py +++ b/pipeline/conf.py @@ -6,6 +6,10 @@ from django.core.signals import setting_changed from django.dispatch import receiver +if getattr(_settings, "PIPELINE_SETTING_NAME", ""): + setting_name = getattr(_settings, "PIPELINE_SETTING_NAME") +else: + setting_name = "PIPELINE" DEFAULTS = { 'PIPELINE_ENABLED': not _settings.DEBUG, @@ -115,10 +119,10 @@ def __getattr__(self, name): return self.__getitem__(name) -settings = PipelineSettings(_settings.PIPELINE) +settings = PipelineSettings(getattr(_settings, setting_name)) @receiver(setting_changed) def reload_settings(**kwargs): - if kwargs['setting'] == 'PIPELINE': + if kwargs['setting'] == setting_name: settings.update(kwargs['value'])