From 320e658595918241c9bdab4f302017039d1ae694 Mon Sep 17 00:00:00 2001 From: Jonathan Rohde Date: Mon, 24 Jun 2024 09:56:42 +0200 Subject: [PATCH] feat(sqlalchemy): cleanup fixes --- backend/apps/socket/main.py | 4 +--- backend/main.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/apps/socket/main.py b/backend/apps/socket/main.py index bbbbccd79..123ff31cd 100644 --- a/backend/apps/socket/main.py +++ b/backend/apps/socket/main.py @@ -24,9 +24,7 @@ async def connect(sid, environ, auth): data = decode_token(auth["token"]) if data is not None and "id" in data: - from apps.webui.internal.db import SessionLocal - - user = Users.get_user_by_id(SessionLocal(), data["id"]) + user = Users.get_user_by_id(data["id"]) if user: SESSION_POOL[sid] = user.id diff --git a/backend/main.py b/backend/main.py index 8892d9bc7..2c4d5ecfd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -751,7 +751,6 @@ class PipelineMiddleware(BaseHTTPMiddleware): user = get_current_user( request, get_http_authorization_cred(request.headers.get("Authorization")), - SessionLocal(), ) try: