Skip to content

Commit d70257c

Browse files
committed
Use new stack trace functionality for CachePanel
1 parent 0b4a623 commit d70257c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

debug_toolbar/panels/cache.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66
from django.core.cache import CacheHandler, caches
77
from django.utils.translation import gettext_lazy as _, ngettext
88

9-
from debug_toolbar import settings as dt_settings
109
from debug_toolbar.panels import Panel
11-
from debug_toolbar.utils import (
12-
get_stack,
13-
get_template_info,
14-
render_stacktrace,
15-
tidy_stacktrace,
16-
)
10+
from debug_toolbar.utils import get_stack_trace, get_template_info, render_stacktrace
1711

1812
# The order of the methods in this list determines the order in which they are listed in
1913
# the Commands table in the panel content.
@@ -135,18 +129,13 @@ def _record_call(self, cache, name, original_method, args, kwargs):
135129
t = time.time() - t
136130
cache._djdt_recording = False
137131

138-
if dt_settings.get_config()["ENABLE_STACKTRACES"]:
139-
stacktrace = tidy_stacktrace(reversed(get_stack()))
140-
else:
141-
stacktrace = []
142-
143132
self._store_call_info(
144133
name=name,
145134
time_taken=t,
146135
return_value=value,
147136
args=args,
148137
kwargs=kwargs,
149-
trace=stacktrace,
138+
trace=get_stack_trace(),
150139
template_info=get_template_info(),
151140
backend=cache,
152141
)

0 commit comments

Comments
 (0)