Skip to content

Commit

Permalink
marked erreneous panels as non async
Browse files Browse the repository at this point in the history
  • Loading branch information
salty-ivy committed Jun 27, 2024
1 parent 95e94b9 commit 1e7939a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions debug_toolbar/panels/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class ProfilingPanel(Panel):
Panel that displays profiling information.
"""

is_async = False
title = _("Profiling")

template = "debug_toolbar/panels/profiling.html"
Expand Down
1 change: 1 addition & 0 deletions debug_toolbar/panels/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class RedirectsPanel(Panel):
Panel that intercepts redirects and displays a page with debug info.
"""

is_async = False
has_content = False

nav_title = _("Intercept redirects")
Expand Down
1 change: 1 addition & 0 deletions debug_toolbar/panels/staticfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class StaticFilesPanel(panels.Panel):
A panel to display the found staticfiles.
"""

is_async = False
name = "Static files"
template = "debug_toolbar/panels/staticfiles.html"

Expand Down
2 changes: 2 additions & 0 deletions debug_toolbar/panels/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class TimerPanel(Panel):
Panel that displays the time a response took in milliseconds.
"""

is_async = False

def nav_subtitle(self):
stats = self.get_stats()
if hasattr(self, "_start_rusage"):
Expand Down
1 change: 1 addition & 0 deletions tests/panels/test_async_panel_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def setUp(self):
self.request = self.factory.get("/")
self.toolbar = None

@override_settings(DEBUG_TOOLBAR_CONFIG=set_custom_toolbar_config())
def test_disable_nonasync_panels_with_asgi(self):
self.toolbar = DebugToolbar(self.request, lambda request: HttpResponse())
for panel in self.toolbar.panels:
Expand Down

0 comments on commit 1e7939a

Please sign in to comment.