Skip to content

Commit

Permalink
refactor(account): Refactor email verification method in account utils
Browse files Browse the repository at this point in the history
  • Loading branch information
muneeb706 committed May 2, 2024
1 parent a7e5452 commit fb79e68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions allauth/account/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,15 +499,14 @@ def assess_unique_email(email) -> Optional[bool]:
False -- email is already in use
None -- email is in use, but we should hide that using email verification.
"""
adapter = get_adapter()
if not filter_users_by_email(email):
# All good.
return True
elif not app_settings.PREVENT_ENUMERATION:
# Fail right away.
return False
elif (
adapter.get_email_verification_method()
get_adapter().get_email_verification_method()
== app_settings.EmailVerificationMethod.MANDATORY
):
# In case of mandatory verification and enumeration prevention,
Expand Down

0 comments on commit fb79e68

Please sign in to comment.