diff options
| author | Aymeric Augustin | 2013-11-15 20:14:40 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-15 20:33:51 +0100 |
| commit | 70d3aa1b8c12d614f2ca1b1b550bb605d8c8a506 (patch) | |
| tree | 00df40543a7e7a3b509dfb3bc2c9efb1f3736e05 /debug_toolbar/panels/__init__.py | |
| parent | 5f54e2d88a12ec7fa06bd2a9dd54e1af2f0b50f7 (diff) | |
| download | django-debug-toolbar-70d3aa1b8c12d614f2ca1b1b550bb605d8c8a506.tar.bz2 | |
Make panels behave more like Django middleware.
Diffstat (limited to 'debug_toolbar/panels/__init__.py')
| -rw-r--r-- | debug_toolbar/panels/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
