File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
debug_toolbar/panels/history Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ from typing import Union
2+
13from django .http import HttpRequest , HttpResponseBadRequest , JsonResponse
24from django .template .loader import render_to_string
35
1113@login_not_required
1214@require_show_toolbar
1315@render_with_toolbar_language
14- def history_sidebar (request : HttpRequest ) -> HttpResponseBadRequest | JsonResponse :
16+ def history_sidebar (
17+ request : HttpRequest ,
18+ ) -> Union [HttpResponseBadRequest , JsonResponse ]:
1519 """Returns the selected debug toolbar history snapshot."""
1620 form = HistoryStoreForm (request .GET )
1721
1822 if form .is_valid ():
1923 request_id : str = form .cleaned_data ["request_id" ]
20- toolbar : DebugToolbar | None = DebugToolbar .fetch (request_id )
24+ toolbar : Union [ DebugToolbar , None ] = DebugToolbar .fetch (request_id )
2125 exclude_history = form .cleaned_data ["exclude_history" ]
2226 context : dict [str , dict [str , str ]] = {}
2327 if toolbar is None :
@@ -43,7 +47,9 @@ def history_sidebar(request: HttpRequest) -> HttpResponseBadRequest | JsonRespon
4347@login_not_required
4448@require_show_toolbar
4549@render_with_toolbar_language
46- def history_refresh (request : HttpRequest ) -> HttpResponseBadRequest | JsonResponse :
50+ def history_refresh (
51+ request : HttpRequest ,
52+ ) -> Union [HttpResponseBadRequest , JsonResponse ]:
4753 """Returns the refreshed list of table rows for the History Panel."""
4854 form = HistoryStoreForm (request .GET )
4955
You can’t perform that action at this time.
0 commit comments