Skip to content

Commit 7136536

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c09ed84 commit 7136536

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

debug_toolbar/panels/history/views.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Union
2-
31
from django.http import HttpRequest, HttpResponseBadRequest, JsonResponse
42
from django.template.loader import render_to_string
53

@@ -15,13 +13,13 @@
1513
@render_with_toolbar_language
1614
def history_sidebar(
1715
request: HttpRequest,
18-
) -> Union[HttpResponseBadRequest, JsonResponse]:
16+
) -> HttpResponseBadRequest | JsonResponse:
1917
"""Returns the selected debug toolbar history snapshot."""
2018
form = HistoryStoreForm(request.GET)
2119

2220
if form.is_valid():
2321
request_id: str = form.cleaned_data["request_id"]
24-
toolbar: Union[DebugToolbar, None] = DebugToolbar.fetch(request_id)
22+
toolbar: DebugToolbar | None = DebugToolbar.fetch(request_id)
2523
exclude_history = form.cleaned_data["exclude_history"]
2624
context: dict[str, dict[str, str]] = {}
2725
if toolbar is None:
@@ -49,7 +47,7 @@ def history_sidebar(
4947
@render_with_toolbar_language
5048
def history_refresh(
5149
request: HttpRequest,
52-
) -> Union[HttpResponseBadRequest, JsonResponse]:
50+
) -> HttpResponseBadRequest | JsonResponse:
5351
"""Returns the refreshed list of table rows for the History Panel."""
5452
form = HistoryStoreForm(request.GET)
5553

0 commit comments

Comments
 (0)