mirror of
https://github.com/open-webui/computer.git
synced 2026-11-20 13:31:27 +03:00
refac
This commit is contained in:
@@ -145,6 +145,12 @@ class Auth(Base):
|
||||
)
|
||||
return result.scalar_one_or_none()
|
||||
|
||||
@staticmethod
|
||||
async def get_by_user_id(user_id: str) -> Auth | None:
|
||||
async with await get_db() as db:
|
||||
result = await db.execute(select(Auth).where(Auth.user_id == user_id))
|
||||
return result.scalar_one_or_none()
|
||||
|
||||
@staticmethod
|
||||
async def username_exists(username: str) -> bool:
|
||||
async with await get_db() as db:
|
||||
|
||||
Reference in New Issue
Block a user