Skip to content

Commit 97f05b0

Browse files
authored
fix linters
1 parent cb3a4c2 commit 97f05b0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

backend/middleware.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import typing as t
2-
31
import ssl
42
from motor.motor_asyncio import AsyncIOMotorClient
5-
from starlette.middleware.base import BaseHTTPMiddleware
63
from starlette.requests import Request
7-
from starlette.responses import JSONResponse, Response
4+
from starlette.responses import JSONResponse
85
from starlette.types import ASGIApp, Scope, Receive, Send
96

107
from backend.constants import DATABASE_URL, DOCS_PASSWORD, MONGO_DATABASE
@@ -34,6 +31,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
3431
request = Request(scope)
3532
if DOCS_PASSWORD and request.url.path.startswith("/docs"):
3633
if request.cookies.get("docs_password") != DOCS_PASSWORD:
37-
await JSONResponse({"status": "unauthorized"}, status_code=403)(scope, receive, send)
34+
resp = JSONResponse({"status": "unauthorized"}, status_code=403)
35+
await resp(scope, receive, send)
3836
return
3937
await self._app(scope, receive, send)

0 commit comments

Comments
 (0)