From 8bd8d604ff886f37e87fcc2f9367a672c92098e0 Mon Sep 17 00:00:00 2001 From: Nic Ducheneaut Date: Sat, 25 Nov 2017 14:10:44 -0800 Subject: [PATCH] Prevent double-validation in LoginSerializer Modified branching statement to prevent double-validation when using "email" as the authentication method with Allauth. --- rest_auth/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py index c5dad7d..45729b2 100644 --- a/rest_auth/serializers.py +++ b/rest_auth/serializers.py @@ -71,7 +71,7 @@ class LoginSerializer(serializers.Serializer): user = self._validate_email(email, password) # Authentication through username - if app_settings.AUTHENTICATION_METHOD == app_settings.AuthenticationMethod.USERNAME: + elif app_settings.AUTHENTICATION_METHOD == app_settings.AuthenticationMethod.USERNAME: user = self._validate_username(username, password) # Authentication through either username or email