diff --git a/constance/backends/database/__init__.py b/constance/backends/database/__init__.py index c751a67..7f7bef0 100644 --- a/constance/backends/database/__init__.py +++ b/constance/backends/database/__init__.py @@ -86,7 +86,7 @@ class DatabaseBackend(Backend): if self._cache: self._cache.set(key, value) - signals.updated_signal.send(sender='constance', key=key, value=value) + signals.config_updated.send(sender='constance', key=key, value=value) def clear(self, sender, instance, created, **kwargs): if self._cache and not created: diff --git a/constance/backends/redisd.py b/constance/backends/redisd.py index f307adf..30a9e28 100644 --- a/constance/backends/redisd.py +++ b/constance/backends/redisd.py @@ -49,4 +49,4 @@ class RedisBackend(Backend): def set(self, key, value): self._rd.set(self.add_prefix(key), dumps(value)) - signals.updated_signal.send(sender='constance', key=key, value=value) + signals.config_updated.send(sender='constance', key=key, value=value) diff --git a/constance/signals.py b/constance/signals.py index 114ceec..e43f940 100644 --- a/constance/signals.py +++ b/constance/signals.py @@ -1,3 +1,3 @@ import django.dispatch -updated_signal = django.dispatch.Signal(providing_args=['key', 'value']) +config_updated = django.dispatch.Signal(providing_args=['key', 'value']) diff --git a/docs/index.rst b/docs/index.rst index c7fde73..5c1ee77 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -72,15 +72,15 @@ Use this option in order to skip hash verification. Signals ------- -Each time a value is changed it will trigger a `updated_signal` signal. +Each time a value is changed it will trigger a `config_updated` signal. You can use it as: .. code-block:: python - from constance.signals import updated_signal + from constance.signals import config_updated - @receiver(updated_signal) + @receiver(config_updated) def constance_updated(sender, key, value, **kwargs): print(sender, key, value)