Skip to content

Commit

Permalink
Merge pull request #71 from flavien-hugs/develop
Browse files Browse the repository at this point in the history
feat: check if user account with phonenumber is desabled
  • Loading branch information
flavien-hugs authored Jan 10, 2025
2 parents 1b5838e + 8f036af commit acfa5cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/auth/phonenumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ async def find_user_by_phonenumber(phonenumber: str):
status_code=status.HTTP_404_NOT_FOUND,
)

if not user.is_active:
raise CustomHTTPException(
code_error=UserErrorCode.USER_ACCOUND_DESABLE,
message_error=f"User account with phone number {phone!r} is disabled."
f" Please request to activate the account.",
status_code=status.HTTP_400_BAD_REQUEST,
)

user_dict = jsonable_encoder(
{
"fullname": user.fullname,
Expand Down

0 comments on commit acfa5cd

Please sign in to comment.