Skip to content

Commit

Permalink
Upd: Query user by mobile number
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Nov 30, 2023
1 parent cb5bcaa commit 00cd0f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion otp_auth/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_user_by_mobile_number(mobile_number: str) -> typing.Tuple[AbstractBaseUs
"""Query `User` instance by mobile number and return the `User` instance, existence boolean"""
User = get_user_model()
try:
user = User.objects.get(username=mobile_number)
user = User.objects.get(mobile_number=mobile_number)
return user, True
except User.DoesNotExist:
return None, False
Expand Down

0 comments on commit 00cd0f8

Please sign in to comment.