[FWA-5] Home Create and List
This commit is contained in:
@ -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
|
||||
|
@ -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'
|
||||
|
Reference in New Issue
Block a user