From 1a5108a23d97f2c6d111afaff433df64c2211955 Mon Sep 17 00:00:00 2001 From: tschilling Date: Fri, 14 Feb 2014 13:56:50 -0500 Subject: Deprecating INTERCEPT_REDIRECTS in favor of DEFAULT_DISABLED_PANELS. --- debug_toolbar/panels/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'debug_toolbar/panels/__init__.py') diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index 178ea6f..e71d7b6 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -4,6 +4,8 @@ import warnings from django.template.loader import render_to_string +from debug_toolbar import settings as dt_settings + class Panel(object): """ @@ -20,7 +22,13 @@ class Panel(object): @property def enabled(self): - return self.toolbar.request.COOKIES.get('djdt' + self.panel_id, 'on') == 'on' + # Check to see if settings has a default value for it + if self.panel_id in dt_settings.CONFIG['DEFAULT_DISABLED_PANELS']: + default = 'off' + else: + default = 'on' + # The user's cookies should override the default value + return self.toolbar.request.COOKIES.get('djdt' + self.panel_id, default) == 'on' # Titles and content -- cgit v1.2.3