From e198f8dddb9d54fd445a4bba105152ab6e5c7efe Mon Sep 17 00:00:00 2001 From: Mathias Lantean Date: Wed, 11 Mar 2020 15:23:22 -0300 Subject: [PATCH] Fix if condition in LoginSerializer As there is no reference to 'rest_auth.registration' this condition always validates to False. We should check if 'dj_rest_auth.registration' is in INSTALLED_APPS. --- dj_rest_auth/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dj_rest_auth/serializers.py b/dj_rest_auth/serializers.py index 07783da..91c7b8a 100644 --- a/dj_rest_auth/serializers.py +++ b/dj_rest_auth/serializers.py @@ -100,7 +100,7 @@ class LoginSerializer(serializers.Serializer): raise exceptions.ValidationError(msg) # If required, is the email verified? - if 'rest_auth.registration' in settings.INSTALLED_APPS: + if 'dj_rest_auth.registration' in settings.INSTALLED_APPS: from allauth.account import app_settings if app_settings.EMAIL_VERIFICATION == app_settings.EmailVerificationMethod.MANDATORY: email_address = user.emailaddress_set.get(email=user.email)