diff options
| author | Colin Howe | 2011-10-07 08:09:31 +0100 | 
|---|---|---|
| committer | Colin Howe | 2011-10-07 08:09:31 +0100 | 
| commit | 295f6f8f9a269cc547054f7094473b4388d58b16 (patch) | |
| tree | 726004a7b3528fecc83b86344e7c21d5e2ce6c7b /debug_toolbar/utils | |
| parent | 9067568b0bbf0c39322f5b761b05463685355b4f (diff) | |
| download | django-debug-toolbar-295f6f8f9a269cc547054f7094473b4388d58b16.tar.bz2 | |
Make stacktraces configurable
Diffstat (limited to 'debug_toolbar/utils')
| -rw-r--r-- | debug_toolbar/utils/tracking/db.py | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py index 97a9241..c808a7f 100644 --- a/debug_toolbar/utils/tracking/db.py +++ b/debug_toolbar/utils/tracking/db.py @@ -71,7 +71,12 @@ class NormalCursorWrapper(object):          finally:              stop = datetime.now()              duration = ms_from_timedelta(stop - start) -            stacktrace = tidy_stacktrace(reversed(inspect.stack())) +            enable_stacktraces = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) \ +                                    .get('ENABLE_STACKTRACES', True) +            if enable_stacktraces: +                stacktrace = tidy_stacktrace(reversed(inspect.stack())) +            else: +                stacktrace = []              _params = ''              try:                  _params = simplejson.dumps([force_unicode(x, strings_only=True) for x in params])  | 
