From 4baa51e0be674428a2314e08efe43628184bc42a Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Thu, 14 Jan 2010 08:02:49 -0800 Subject: Template panel context cleanup. All panels get a copy of the template context when created and use an updated copy when rendering so they can have full access to context vars and avoid making changes to the shared context. Signed-off-by: Rob Hudson --- debug_toolbar/panels/timer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/panels/timer.py') diff --git a/debug_toolbar/panels/timer.py b/debug_toolbar/panels/timer.py index 583c1c0..d866166 100644 --- a/debug_toolbar/panels/timer.py +++ b/debug_toolbar/panels/timer.py @@ -84,7 +84,10 @@ class TimerDebugPanel(DebugPanel): # ('Page faults', '%d no i/o, %d requiring i/o' % (minflt, majflt)), # ('Disk operations', '%d in, %d out, %d swapout' % (blkin, blkout, swap)), ) - context = { + + context = self.context.copy() + context.update({ 'rows': rows, - } + }) + return render_to_string('debug_toolbar/panels/timer.html', context) -- cgit v1.2.3