mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 17:26:55 +08:00
perf: User account repeat validate
This commit is contained in:
@@ -73,7 +73,7 @@ async def clean_user_cache(id: int):
|
||||
|
||||
|
||||
def check_account_exists(*, session: Session, account: str) -> bool:
|
||||
session.exec(select(func.count()).select_from(UserModel).where(UserModel.account == account)).one() > 0
|
||||
return session.exec(select(func.count()).select_from(UserModel).where(UserModel.account == account)).one() > 0
|
||||
def check_email_exists(*, session: Session, email: str) -> bool:
|
||||
return session.exec(select(func.count()).select_from(UserModel).where(UserModel.email == email)).one() > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user