aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/tracking/db.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-12 22:05:52 +0100
committerAymeric Augustin2013-11-12 22:15:50 +0100
commitf48039e3bad9e24a59a25ed5636b428e11784da9 (patch)
treedbb6471cbf1ceb504d9932639b3ca40a57b89a31 /debug_toolbar/utils/tracking/db.py
parentc1d50fc79645c71987ae156d371777dd371c422d (diff)
downloaddjango-debug-toolbar-f48039e3bad9e24a59a25ed5636b428e11784da9.tar.bz2
Move the logic to load panels inside the DebugToolbar class.
This has the additional advantage of eliminating a side-effect that happened at import time unnecessarily. It justified refactoring the way we handle settings and defaults.
Diffstat (limited to 'debug_toolbar/utils/tracking/db.py')
-rw-r--r--debug_toolbar/utils/tracking/db.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py
index 157334a..fd56ff9 100644
--- a/debug_toolbar/utils/tracking/db.py
+++ b/debug_toolbar/utils/tracking/db.py
@@ -11,7 +11,7 @@ from django.utils.encoding import force_text
from django.utils import six
from debug_toolbar.utils import tidy_stacktrace, get_template_info, get_stack
-from debug_toolbar.utils.settings import CONFIG
+from debug_toolbar.utils import settings as dt_settings
class SQLQueryTriggered(Exception):
@@ -92,7 +92,7 @@ class NormalCursorWrapper(object):
finally:
stop_time = time()
duration = (stop_time - start_time) * 1000
- if CONFIG['ENABLE_STACKTRACES']:
+ if dt_settings.CONFIG['ENABLE_STACKTRACES']:
stacktrace = tidy_stacktrace(reversed(get_stack()))
else:
stacktrace = []
@@ -135,7 +135,7 @@ class NormalCursorWrapper(object):
'stacktrace': stacktrace,
'start_time': start_time,
'stop_time': stop_time,
- 'is_slow': duration > CONFIG['SQL_WARNING_THRESHOLD'],
+ 'is_slow': duration > dt_settings.CONFIG['SQL_WARNING_THRESHOLD'],
'is_select': sql.lower().strip().startswith('select'),
'template_info': template_info,
}