From 42fef2944640659b95679381a9c8f02b3be884b1 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 23 Nov 2013 18:18:42 +0100 Subject: [PATCH] Fixed #21486 -- Prevented settings config in signal connection This was particularly problematic in the chain get_wsgi_application -> db.connections import -> signal connection -> settings configuration. Thanks Jon Dufresne for the report. --- django/dispatch/dispatcher.py | 2 +- docs/releases/1.6.1.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py index a8cdc93b21..d26433a885 100644 --- a/django/dispatch/dispatcher.py +++ b/django/dispatch/dispatcher.py @@ -85,7 +85,7 @@ class Signal(object): from django.conf import settings # If DEBUG is on, check that we got a good receiver - if settings.DEBUG: + if settings.configured and settings.DEBUG: import inspect assert callable(receiver), "Signal receivers must be callable." diff --git a/docs/releases/1.6.1.txt b/docs/releases/1.6.1.txt index 683b231c77..156378f928 100644 --- a/docs/releases/1.6.1.txt +++ b/docs/releases/1.6.1.txt @@ -35,3 +35,5 @@ Bug fixes promised: Support of multiple locale names separated by commas. It's still possible to specify multiplle locales in one run by suing the option multiple times (#21488, #17181). +* Fixed a regression that unnecessarily triggered settings configuration when + importing ``get_wsgi_application`` (#21486).