Fixed #16447 -- Stopped using the setting name as the sender parameter for the setting_changed signal. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
54b9c03d80
commit
723b574793
|
@ -177,7 +177,7 @@ class OverrideSettingsHolder(UserSettingsHolder):
|
||||||
"""
|
"""
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name, value):
|
||||||
UserSettingsHolder.__setattr__(self, name, value)
|
UserSettingsHolder.__setattr__(self, name, value)
|
||||||
setting_changed.send(sender=name, setting=name, value=value)
|
setting_changed.send(sender=self.__class__, setting=name, value=value)
|
||||||
|
|
||||||
|
|
||||||
class override_settings(object):
|
class override_settings(object):
|
||||||
|
|
|
@ -487,7 +487,7 @@ Sent when some :ref:`settings are overridden <overriding-setting>` with the
|
||||||
Arguments sent with this signal:
|
Arguments sent with this signal:
|
||||||
|
|
||||||
``sender``
|
``sender``
|
||||||
The setting name (string).
|
The settings handler.
|
||||||
|
|
||||||
``setting``
|
``setting``
|
||||||
Same as sender
|
Same as sender
|
||||||
|
|
|
@ -24,10 +24,11 @@ class SettingGetter(object):
|
||||||
testvalue = None
|
testvalue = None
|
||||||
|
|
||||||
def signal_callback(sender, setting, value, **kwargs):
|
def signal_callback(sender, setting, value, **kwargs):
|
||||||
|
if setting == 'TEST':
|
||||||
global testvalue
|
global testvalue
|
||||||
testvalue = value
|
testvalue = value
|
||||||
|
|
||||||
signals.setting_changed.connect(signal_callback, sender='TEST')
|
signals.setting_changed.connect(signal_callback)
|
||||||
|
|
||||||
class SettingsTests(TestCase):
|
class SettingsTests(TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue