feat(sqlalchemy): Replace peewee with sqlalchemy

This commit is contained in:
Jonathan Rohde
2024-06-18 15:03:31 +02:00
parent 8dac2a2140
commit df09d0830a
47 changed files with 2580 additions and 1003 deletions

View File

@@ -24,7 +24,9 @@ async def connect(sid, environ, auth):
data = decode_token(auth["token"])
if data is not None and "id" in data:
user = Users.get_user_by_id(data["id"])
from apps.webui.internal.db import SessionLocal
user = Users.get_user_by_id(SessionLocal(), data["id"])
if user:
SESSION_POOL[sid] = user.id