Skip to content

Commit

Permalink
fix: Fix debug toolbar upgrade issue (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 authored Jul 24, 2024
1 parent 6f5fe02 commit 6dc6be9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion strawberry_django/middlewares/debug_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from typing import Optional

from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async
from debug_toolbar.middleware import _HTML_TYPES, get_show_toolbar # noqa: PLC2701
from debug_toolbar.middleware import (
DebugToolbarMiddleware as _DebugToolbarMiddleware,
)
from debug_toolbar.middleware import get_show_toolbar
from debug_toolbar.panels.sql.panel import SQLPanel
from debug_toolbar.panels.templates import TemplatesPanel
from debug_toolbar.toolbar import DebugToolbar
Expand All @@ -23,6 +23,8 @@
from django.utils.encoding import force_str
from strawberry.django.views import BaseView

_HTML_TYPES = {"text/html", "application/xhtml+xml"}

_store_cache = weakref.WeakKeyDictionary()
_debug_toolbar_map: "weakref.WeakKeyDictionary[HttpRequest, DebugToolbar]" = (
weakref.WeakKeyDictionary()
Expand Down

0 comments on commit 6dc6be9

Please sign in to comment.