Skip to content

Commit

Permalink
Allow customization of the setting name
Browse files Browse the repository at this point in the history
This update is a potential improvement to work around issues such as jazzband#734.
  • Loading branch information
dedayoa authored Nov 16, 2020
1 parent f004181 commit 1bc70d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pipeline/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'])

0 comments on commit 1bc70d4

Please sign in to comment.