diff options
author | 2024-07-08 15:09:17 +0100 | |
---|---|---|
committer | 2024-07-08 15:09:17 +0100 | |
commit | 642c0795c8738bf8b9ae39b9cf0180f7cdbac650 (patch) | |
tree | 4a075255d00d9f8a2f369567bdb79f6eefa4be9a /backend/middleware.py | |
parent | Migration to official Sentry release CI action (#275) (diff) | |
parent | Stop using gunicorn and use uvicorn directly to run application (diff) |
Merge pull request #276 from python-discord/jb3/environ/python-3.12
3.12 + Updates
Diffstat (limited to 'backend/middleware.py')
-rw-r--r-- | backend/middleware.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/backend/middleware.py b/backend/middleware.py index 7a3bdc8..0b08859 100644 --- a/backend/middleware.py +++ b/backend/middleware.py @@ -7,14 +7,13 @@ from backend.constants import DATABASE_URL, DOCS_PASSWORD, MONGO_DATABASE class DatabaseMiddleware: - def __init__(self, app: ASGIApp) -> None: self._app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: client: AsyncIOMotorClient = AsyncIOMotorClient( DATABASE_URL, - tlsAllowInvalidCertificates=True + tlsAllowInvalidCertificates=True, ) db = client[MONGO_DATABASE] Request(scope).state.db = db @@ -22,7 +21,6 @@ class DatabaseMiddleware: class ProtectedDocsMiddleware: - def __init__(self, app: ASGIApp) -> None: self._app = app |