diff options
Diffstat (limited to 'debug_toolbar/utils')
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/utils/tracking/db.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index da2e3c3..73e38e2 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -68,7 +68,7 @@ def tidy_stacktrace(stack): # inspection. if '__traceback_hide__' in frame.f_locals: continue - if hide_django_sql 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 omit_path(s_path): continue diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py index b4ceff0..5822270 100644 --- a/debug_toolbar/utils/tracking/db.py +++ b/debug_toolbar/utils/tracking/db.py @@ -16,8 +16,8 @@ from debug_toolbar.utils import tidy_stacktrace, get_template_info, get_stack # TODO:This should be set in the toolbar loader as a default and panels should # get a copy of the toolbar object with access to its config dictionary -SQL_WARNING_THRESHOLD = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) \ - .get('SQL_WARNING_THRESHOLD', 500) +DEBUG_TOOLBAR_CONFIG = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) +SQL_WARNING_THRESHOLD = DEBUG_TOOLBAR_CONFIG.get('SQL_WARNING_THRESHOLD', 500) class SQLQueryTriggered(Exception): @@ -82,7 +82,7 @@ class NormalCursorWrapper(object): return params if isinstance(params, dict): return dict((key, self._quote_expr(value)) - for key, value in params.items()) + for key, value in params.items()) return list(map(self._quote_expr, params)) def _decode(self, param): @@ -98,8 +98,8 @@ class NormalCursorWrapper(object): finally: stop_time = time() duration = (stop_time - start_time) * 1000 - enable_stacktraces = getattr(settings, - 'DEBUG_TOOLBAR_CONFIG', {}).get('ENABLE_STACKTRACES', True) + debug_toolbar_config = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) + enable_stacktraces = debug_toolbar_config.get('ENABLE_STACKTRACES', True) if enable_stacktraces: stacktrace = tidy_stacktrace(reversed(get_stack())) else: |
