Skip to content

Commit

Permalink
Fix TestClient.client is None
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Feb 12, 2024
1 parent 30d445c commit 8f52371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debug_toolbar/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def show_toolbar(request: Request, settings: DebugToolbarSettings) -> bool:
if settings.ALLOWED_HOSTS is not None:
if request.client is not None and settings.ALLOWED_HOSTS is not None:
return request.app.debug and request.client.host in settings.ALLOWED_HOSTS
return request.app.debug

Expand Down

0 comments on commit 8f52371

Please sign in to comment.