From 70d3aa1b8c12d614f2ca1b1b550bb605d8c8a506 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 15 Nov 2013 20:14:40 +0100 Subject: Make panels behave more like Django middleware. --- debug_toolbar/panels/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'debug_toolbar/panels/__init__.py') diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index 47ca996..d64aac2 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -14,9 +14,6 @@ class DebugPanel(object): # If content returns something, set to True in subclass has_content = False - # This can be set to False in instances if the panel is disabled. - enabled = True - # We'll maintain a local context instance so we can expose our template # context variables to panels which need them: context = {} @@ -37,6 +34,9 @@ class DebugPanel(object): def dom_id(self): return 'djDebug%sPanel' % (self.name.replace(' ', '')) + def enabled(self): + return self.toolbar.request.COOKIES.get(self.dom_id(), 'on') == 'on' + # URLs for panel-specific views @classmethod -- cgit v1.2.3