Skip to content

Commit 41e26d8

Browse files
committed
Stop getting a setting all the time.
1 parent 7fa83ed commit 41e26d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

debug_toolbar/utils/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def ms_from_timedelta(td):
2121
return (td.seconds * 1000) + (td.microseconds / 1000.0)
2222

2323

24+
hide_django_sql = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('HIDE_DJANGO_SQL', True)
25+
26+
2427
def tidy_stacktrace(stack):
2528
"""
2629
Clean up stacktrace and remove all entries that:
@@ -37,8 +40,7 @@ def tidy_stacktrace(stack):
3740
# inspection.
3841
if '__traceback_hide__' in frame.f_locals:
3942
continue
40-
if getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('HIDE_DJANGO_SQL', True) \
41-
and django_path in s_path and not 'django/contrib' in s_path:
43+
if hide_django_sql and django_path in s_path and not 'django/contrib' in s_path:
4244
continue
4345
if socketserver_path in s_path:
4446
continue
@@ -62,7 +64,6 @@ def render_stacktrace(trace):
6264
return mark_safe('\n'.join(stacktrace))
6365

6466

65-
6667
def get_template_info(source, context_lines=3):
6768
line = 0
6869
upto = 0

0 commit comments

Comments
 (0)