fix: bad user get

This commit is contained in:
Jun Siang Cheah 2024-05-26 13:07:41 +01:00
parent 7385016e36
commit 776bb2892c

View File

@ -114,7 +114,7 @@ class UsersTable:
def get_user_by_email(self, email: str) -> Optional[UserModel]: def get_user_by_email(self, email: str) -> Optional[UserModel]:
try: try:
user = User.get(User.email == email and User.oauth_sub.is_null()) user = User.get((User.email == email, User.oauth_sub.is_null()))
return UserModel(**model_to_dict(user)) return UserModel(**model_to_dict(user))
except: except:
return None return None