Skip to content

Commit 0b4a623

Browse files
committed
Use new stack trace functionality for SQLPanel
1 parent 5a8c11d commit 0b4a623

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from django.utils.encoding import force_str
77

88
from debug_toolbar import settings as dt_settings
9-
from debug_toolbar.utils import get_stack, get_template_info, tidy_stacktrace
9+
from debug_toolbar.utils import get_stack_trace, get_template_info
1010

1111
try:
1212
from psycopg2._json import Json as PostgresJson
@@ -155,10 +155,6 @@ def _record(self, method, sql, params):
155155
finally:
156156
stop_time = time()
157157
duration = (stop_time - start_time) * 1000
158-
if dt_settings.get_config()["ENABLE_STACKTRACES"]:
159-
stacktrace = tidy_stacktrace(reversed(get_stack()))
160-
else:
161-
stacktrace = []
162158
_params = ""
163159
try:
164160
_params = json.dumps(self._decode(params))
@@ -180,7 +176,7 @@ def _record(self, method, sql, params):
180176
"raw_sql": sql,
181177
"params": _params,
182178
"raw_params": params,
183-
"stacktrace": stacktrace,
179+
"stacktrace": get_stack_trace(),
184180
"start_time": start_time,
185181
"stop_time": stop_time,
186182
"is_slow": duration > dt_settings.get_config()["SQL_WARNING_THRESHOLD"],

0 commit comments

Comments
 (0)