aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/__init__.py
diff options
context:
space:
mode:
authorJannis Leidel2012-05-13 12:13:22 +0200
committerJannis Leidel2012-05-13 12:13:22 +0200
commit41e26d8d710d693bffc9d8b85c701c6e891c3573 (patch)
tree6441bf4c2041c1a92fec6a78d0abbfe9f8052df7 /debug_toolbar/utils/__init__.py
parent7fa83ed02ee038802d41f955966c892148385bae (diff)
downloaddjango-debug-toolbar-41e26d8d710d693bffc9d8b85c701c6e891c3573.tar.bz2
Stop getting a setting all the time.
Diffstat (limited to 'debug_toolbar/utils/__init__.py')
-rw-r--r--debug_toolbar/utils/__init__.py7
1 files changed, 4 insertions, 3 deletions
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