From 3d639ab35c2ca038d738253b93b593a755756cff Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 16 Nov 2013 09:58:32 +0100 Subject: Avoid providing the same information through multiple paths. --- debug_toolbar/panels/signals.py | 3 +-- debug_toolbar/panels/template/panel.py | 3 +-- debug_toolbar/templates/debug_toolbar/base.html | 12 ++++++------ debug_toolbar/toolbar.py | 26 +++++++++++-------------- 4 files changed, 19 insertions(+), 25 deletions(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/signals.py b/debug_toolbar/panels/signals.py index 1d24b80..25e250b 100644 --- a/debug_toolbar/panels/signals.py +++ b/debug_toolbar/panels/signals.py @@ -16,7 +16,6 @@ except ImportError: connection_created = None from debug_toolbar.panels import DebugPanel -from debug_toolbar.utils import settings as dt_settings class SignalDebugPanel(DebugPanel): @@ -63,7 +62,7 @@ class SignalDebugPanel(DebugPanel): @property def signals(self): signals = self.SIGNALS.copy() - for signal in dt_settings.CONFIG['EXTRA_SIGNALS']: + for signal in self.toolbar.config['EXTRA_SIGNALS']: mod_path, signal_name = signal.rsplit('.', 1) signals_mod = import_module(mod_path) signals[signal_name] = getattr(signals_mod, signal_name) diff --git a/debug_toolbar/panels/template/panel.py b/debug_toolbar/panels/template/panel.py index 7c4b06a..b877a53 100644 --- a/debug_toolbar/panels/template/panel.py +++ b/debug_toolbar/panels/template/panel.py @@ -16,7 +16,6 @@ from django.utils.translation import ugettext_lazy as _ from debug_toolbar.panels import DebugPanel from debug_toolbar.panels.sql.tracking import recording, SQLQueryTriggered -from debug_toolbar.utils import settings as dt_settings # Code taken and adapted from Simon Willison and Django Snippets: # http://www.djangosnippets.org/snippets/766/ @@ -147,7 +146,7 @@ class TemplateDebugPanel(DebugPanel): template.origin_name = 'No origin' info['template'] = template # Clean up context for better readability - if dt_settings.CONFIG['SHOW_TEMPLATE_CONTEXT']: + if self.toolbar.config['SHOW_TEMPLATE_CONTEXT']: context_list = template_data.get('context', []) info['context'] = '\n'.join(context_list) template_context.append(info) diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 424dc57..b54a343 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -9,16 +9,16 @@ if(!window.jQuery) document.write('