Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #16447 -- Stopped using the setting name as the sender paramete…

…r for the setting_changed signal. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 723b5747933f8519708a1b75e1c01478151dec33 1 parent 54b9c03
@jezdez jezdez authored
View
2  django/test/utils.py
@@ -177,7 +177,7 @@ class OverrideSettingsHolder(UserSettingsHolder):
"""
def __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):
View
2  docs/ref/signals.txt
@@ -487,7 +487,7 @@ Sent when some :ref:`settings are overridden <overriding-setting>` with the
Arguments sent with this signal:
``sender``
- The setting name (string).
+ The settings handler.
``setting``
Same as sender
View
7 tests/regressiontests/settings_tests/tests.py
@@ -24,10 +24,11 @@ def __init__(self):
testvalue = None
def signal_callback(sender, setting, value, **kwargs):
- global testvalue
- testvalue = value
+ if setting == 'TEST':
+ global testvalue
+ testvalue = value
-signals.setting_changed.connect(signal_callback, sender='TEST')
+signals.setting_changed.connect(signal_callback)
class SettingsTests(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.