浏览代码

feat(sqlalchemy): cleanup fixes

Jonathan Rohde 10 月之前
父节点
当前提交
320e658595
共有 2 个文件被更改,包括 1 次插入4 次删除
  1. 1 3
      backend/apps/socket/main.py
  2. 0 1
      backend/main.py

+ 1 - 3
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

+ 0 - 1
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: