Skip to content

Commit

Permalink
Support custom verification status based on email (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-w committed May 7, 2023
1 parent a174adb commit 50f2a9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dj_rest_auth/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def validate_auth_user_status(user):
raise exceptions.ValidationError(msg)

@staticmethod
def validate_email_verification_status(user):
def validate_email_verification_status(user, email=None):
from allauth.account import app_settings as allauth_account_settings
if (
allauth_account_settings.EMAIL_VERIFICATION == allauth_account_settings.EmailVerificationMethod.MANDATORY
Expand All @@ -130,7 +130,7 @@ def validate(self, attrs):

# If required, is the email verified?
if 'dj_rest_auth.registration' in settings.INSTALLED_APPS:
self.validate_email_verification_status(user)
self.validate_email_verification_status(user, email=email)

attrs['user'] = user
return attrs
Expand Down

0 comments on commit 50f2a9c

Please sign in to comment.