Skip to content

Commit 0cefbe7

Browse files
committed
Fix history sidebar to only include enabled panels
The DatabaseStore fix caused all panels to be loaded, including disabled ones like ProfilingPanel. The history sidebar was including all panels in its JSON response rather than filtering by enabled status. This change adds a check for panel.enabled in the history sidebar view to ensure only enabled panels are included in the response, matching the behavior expected by tests and consistent with the main toolbar display logic. Fixes failing tests: - test_history_sidebar - test_history_sidebar_expired_request_id - test_history_sidebar_includes_history
1 parent d37c910 commit 0cefbe7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

debug_toolbar/panels/history/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def history_sidebar(request):
2727
for panel in toolbar.panels:
2828
if exclude_history and not panel.is_historical:
2929
continue
30+
# Only include enabled panels in the history sidebar
31+
if not panel.enabled:
32+
continue
3033
panel_context = {"panel": panel}
3134
context[panel.panel_id] = {
3235
"button": render_to_string(

docs/changes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Pending
77
* Added a note about the default password in ``make example``.
88
* Removed logging about the toolbar failing to serialize a value into JSON.
99
* Fixed KeyError when using DatabaseStore with dynamically added panels to
10-
DEBUG_TOOLBAR_PANELS.
10+
DEBUG_TOOLBAR_PANELS. Also fixed history sidebar to only include enabled
11+
panels.
1112

1213
6.0.0 (2025-07-22)
1314
------------------

0 commit comments

Comments
 (0)