aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/__init__.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-29 22:22:38 +0100
committerAymeric Augustin2013-11-29 22:24:09 +0100
commitc33ce081f270b43fffe8af33bf50ae821aa12fcf (patch)
tree4057ccbd22201dd977cd3b1c945aabe27728d454 /debug_toolbar/panels/__init__.py
parentc12de857b96960bdb506d084b186b62e0c4bd292 (diff)
downloaddjango-debug-toolbar-c33ce081f270b43fffe8af33bf50ae821aa12fcf.tar.bz2
Stop sharing unsafely a context dict across threads.
Panels that need to share data with other panels shall do it through the record_stats / get_stats API. Statistics are automatically pushed to the template context. Fix #450.
Diffstat (limited to 'debug_toolbar/panels/__init__.py')
-rw-r--r--debug_toolbar/panels/__init__.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py
index 1b2a767..178ea6f 100644
--- a/debug_toolbar/panels/__init__.py
+++ b/debug_toolbar/panels/__init__.py
@@ -9,16 +9,10 @@ class Panel(object):
"""
Base class for panels.
"""
-
- # We'll maintain a local context instance so we can expose our template
- # context variables to panels which need them. (But see issue #450.)
- context = {}
-
- # Private panel methods
-
- def __init__(self, toolbar, context={}):
+ def __init__(self, toolbar):
self.toolbar = toolbar
- self.context.update(context)
+
+ # Private panel properties
@property
def panel_id(self):
@@ -81,9 +75,7 @@ class Panel(object):
template's context.
"""
if self.has_content:
- context = self.context.copy()
- context.update(self.get_stats())
- return render_to_string(self.template, context)
+ return render_to_string(self.template, self.get_stats())
# URLs for panel-specific views