aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/settings.py
diff options
context:
space:
mode:
authortschilling2014-02-15 08:59:20 -0500
committertschilling2014-02-15 08:59:20 -0500
commitcc08c0d19bd5d1c7ff2281e3c3e4d92fa932e6d5 (patch)
tree8f73b3d7dfb0c603aacf034e53d95ecaa7210a85 /debug_toolbar/settings.py
parent1a5108a23d97f2c6d111afaff433df64c2211955 (diff)
downloaddjango-debug-toolbar-cc08c0d19bd5d1c7ff2281e3c3e4d92fa932e6d5.tar.bz2
Changing the collection to be fully qualified names and for it to be a set not a tuple.
Diffstat (limited to 'debug_toolbar/settings.py')
-rw-r--r--debug_toolbar/settings.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/debug_toolbar/settings.py b/debug_toolbar/settings.py
index 2d02aa5..0ea75ab 100644
--- a/debug_toolbar/settings.py
+++ b/debug_toolbar/settings.py
@@ -16,7 +16,7 @@ from django.utils import six
CONFIG_DEFAULTS = {
# Toolbar options
- 'DEFAULT_DISABLED_PANELS': ('RedirectsPanel', ),
+ 'DEFAULT_DISABLED_PANELS': {'debug_toolbar.panels.redirects.RedirectsPanel'},
'INSERT_BEFORE': '</body>',
'RENDER_PANELS': None,
'RESULTS_STORE_SIZE': 10,
@@ -131,15 +131,22 @@ if 'INTERCEPT_REDIRECTS' in USER_CONFIG:
"DEFAULT_DISABLED_PANELS config in the"
"DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
if USER_CONFIG['INTERCEPT_REDIRECTS']:
- if 'RedirectsPanel' in CONFIG['DEFAULT_DISABLED_PANELS']:
+ if 'debug_toolbar.panels.redirects.RedirectsPanel' \
+ in CONFIG['DEFAULT_DISABLED_PANELS']:
# RedirectsPanel should be enabled
- CONFIG['DEFAULT_DISABLED_PANELS'] = [
- panel for panel in CONFIG['DEFAULT_DISABLED_PANELS']
- if panel != "RedirectsPanel"
- ]
- elif not 'RedirectsPanel' in CONFIG['DEFAULT_DISABLED_PANELS']:
+ try:
+ CONFIG['DEFAULT_DISABLED_PANELS'].remove(
+ 'debug_toolbar.panels.redirects.RedirectsPanel'
+ )
+ except KeyError:
+ # We wanted to remove it, but it didn't exist. This is fine
+ pass
+ elif not 'debug_toolbar.panels.redirects.RedirectsPanel' \
+ in CONFIG['DEFAULT_DISABLED_PANELS']:
# RedirectsPanel should be disabled
- CONFIG['DEFAULT_DISABLED_PANELS'].append('RedirectsPanel')
+ CONFIG['DEFAULT_DISABLED_PANELS'].add(
+ 'debug_toolbar.panels.redirects.RedirectsPanel'
+ )
PATCH_SETTINGS = getattr(settings, 'DEBUG_TOOLBAR_PATCH_SETTINGS', settings.DEBUG)