From 41e26d8d710d693bffc9d8b85c701c6e891c3573 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 13 May 2012 12:13:22 +0200 Subject: Stop getting a setting all the time. --- debug_toolbar/utils/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'debug_toolbar/utils') diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index f7a3de0..bfb485c 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -21,6 +21,9 @@ def ms_from_timedelta(td): return (td.seconds * 1000) + (td.microseconds / 1000.0) +hide_django_sql = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('HIDE_DJANGO_SQL', True) + + def tidy_stacktrace(stack): """ Clean up stacktrace and remove all entries that: @@ -37,8 +40,7 @@ def tidy_stacktrace(stack): # inspection. if '__traceback_hide__' in frame.f_locals: continue - if getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('HIDE_DJANGO_SQL', True) \ - and django_path in s_path and not 'django/contrib' in s_path: + if hide_django_sql and django_path in s_path and not 'django/contrib' in s_path: continue if socketserver_path in s_path: continue @@ -62,7 +64,6 @@ def render_stacktrace(trace): return mark_safe('\n'.join(stacktrace)) - def get_template_info(source, context_lines=3): line = 0 upto = 0 -- cgit v1.2.3