Skip to content

Commit 6c7b53b

Browse files
committed
Tests
1 parent d29dc79 commit 6c7b53b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drfpasswordless/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ def verify_user_alias(user, token):
8585
Marks a user's contact point as verified depending on accepted token type.
8686
"""
8787
if token.to_alias_type == 'EMAIL':
88-
setattr(user, api_settings.PASSWORDLESS_USER_EMAIL_VERIFIED_FIELD_NAME, True)
88+
if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_EMAIL_FIELD_NAME):
89+
setattr(user, api_settings.PASSWORDLESS_USER_EMAIL_VERIFIED_FIELD_NAME, True)
8990
elif token.to_alias_type == 'MOBILE':
90-
setattr(user, api_settings.PASSWORDLESS_USER_MOBILE_VERIFIED_FIELD_NAME, True)
91+
if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME):
92+
setattr(user, api_settings.PASSWORDLESS_USER_MOBILE_VERIFIED_FIELD_NAME, True)
9193
else:
9294
return False
9395
user.save()

0 commit comments

Comments
 (0)