Skip to content

Commit 3a0213f

Browse files
perf: User account repeat validate
1 parent 7485678 commit 3a0213f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/apps/system/crud/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def clean_user_cache(id: int):
7373

7474

7575
def check_account_exists(*, session: Session, account: str) -> bool:
76-
session.exec(select(func.count()).select_from(UserModel).where(UserModel.account == account)).one() > 0
76+
return session.exec(select(func.count()).select_from(UserModel).where(UserModel.account == account)).one() > 0
7777
def check_email_exists(*, session: Session, email: str) -> bool:
7878
return session.exec(select(func.count()).select_from(UserModel).where(UserModel.email == email)).one() > 0
7979

0 commit comments

Comments
 (0)