[FWA-5] Home Create and List

This commit is contained in:
2024-07-03 08:57:50 +00:00
parent 1c205c69ac
commit b938f296c1
33 changed files with 414 additions and 93 deletions

View File

@ -30,7 +30,7 @@ async def is_logged_in(token: str = Depends(oauth2_scheme_soft_fail)) -> bool:
user = user_service.get_by_id(user_id)
if not user:
raise credentials_exception
if user.is_lock is True:
if user.is_lock is not None:
raise HTTPException(status_code=status.HTTP_423_LOCKED, detail=MessageCode.ACCOUNT_LOCK)
except Exception:
return credentials_exception

View File

@ -1,6 +1,9 @@
class MessageCode():
CREATE_USER_SUCCESS: str = 'CREATE_USER_SUCCESS'
CREATED_USER: str = 'CREATED_USER'
WRONG_INPUT: str = 'LOGIN_WRONG'
ACCOUNT_LOCK: str = 'USER_LOCK'
REFRESH_TOKEN_EXPIRED: str = 'REFRESH_TOKEN_EXPIRED'
CREATE_HOUSE_FAIL: str = 'CREATE_HOUSE_FAIL'
CREATE_HOUSE_SUCCESS: str = 'CREATE_HOUSE_SUCCESS'