Fix #485 where empty email throws "User is already registered"

This commit is contained in:
olivierdalang 2019-05-23 22:08:01 +02:00
parent 624ad01afb
commit 38b9c65680

View File

@ -129,7 +129,7 @@ class SocialLoginSerializer(serializers.Serializer):
# with the same email address: raise an exception. # with the same email address: raise an exception.
# This needs to be handled in the frontend. We can not just # This needs to be handled in the frontend. We can not just
# link up the accounts due to security constraints # link up the accounts due to security constraints
if allauth_settings.UNIQUE_EMAIL: if login.user.email and allauth_settings.UNIQUE_EMAIL:
# Do we have an account already with this email address? # Do we have an account already with this email address?
account_exists = get_user_model().objects.filter( account_exists = get_user_model().objects.filter(
email=login.user.email, email=login.user.email,