Prevent double-validation in LoginSerializer

Modified branching statement to prevent double-validation when using "email" as the authentication method with Allauth.
This commit is contained in:
Nic Ducheneaut 2017-11-25 14:10:44 -08:00 committed by GitHub
parent 658664a7d4
commit 8bd8d604ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ class LoginSerializer(serializers.Serializer):
user = self._validate_email(email, password) user = self._validate_email(email, password)
# Authentication through username # 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) user = self._validate_username(username, password)
# Authentication through either username or email # Authentication through either username or email