Author: russellm
Date: 2010-01-31 17:38:17 -0600 (Sun, 31 Jan 2010)
New Revision: 12361

Modified:
   django/trunk/django/views/debug.py
Log:
Fixed #12744 -- Improved the settings cleansing process the work with 
dictionary settings that are keyed by non-strings. Thanks to minmax for the 
report.

Modified: django/trunk/django/views/debug.py
===================================================================
--- django/trunk/django/views/debug.py  2010-01-31 02:30:02 UTC (rev 12360)
+++ django/trunk/django/views/debug.py  2010-01-31 23:38:17 UTC (rev 12361)
@@ -26,13 +26,17 @@
     If the value is a dictionary, recursively cleanse the keys in
     that dictionary.
     """
-    if HIDDEN_SETTINGS.search(key):
-        cleansed = '********************'
-    else:
-        if isinstance(value, dict):
-            cleansed = dict((k, cleanse_setting(k, v)) for k,v in 
value.items())
+    try:
+        if HIDDEN_SETTINGS.search(key):
+            cleansed = '********************'
         else:
-            cleansed = value
+            if isinstance(value, dict):
+                cleansed = dict((k, cleanse_setting(k, v)) for k,v in 
value.items())
+            else:
+                cleansed = value
+    except TypeError:
+        # If the key isn't regex-able, just return as-is.
+        cleansed = value
     return cleansed
 
 def get_safe_settings():

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to