Skip to content

Commit 7afb0dd

Browse files
committed
Exclude tracking frames from stack traces
Ensure that stack traces do not include any of the cache or SQL panel tracking infrastructure even if HIDE_IN_STACKTRACES is empty.
1 parent dc84278 commit 7afb0dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

debug_toolbar/panels/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _record_call(self, cache, name, original_method, args, kwargs):
135135
return_value=value,
136136
args=args,
137137
kwargs=kwargs,
138-
trace=get_stack_trace(),
138+
trace=get_stack_trace(skip=2),
139139
template_info=get_template_info(),
140140
backend=cache,
141141
)

debug_toolbar/panels/sql/tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _record(self, method, sql, params):
176176
"raw_sql": sql,
177177
"params": _params,
178178
"raw_params": params,
179-
"stacktrace": get_stack_trace(),
179+
"stacktrace": get_stack_trace(skip=2),
180180
"start_time": start_time,
181181
"stop_time": stop_time,
182182
"is_slow": duration > dt_settings.get_config()["SQL_WARNING_THRESHOLD"],

0 commit comments

Comments
 (0)