From 38b9c656808b08b2502daa8d099bdb49476c5fc5 Mon Sep 17 00:00:00 2001 From: olivierdalang Date: Thu, 23 May 2019 22:08:01 +0200 Subject: [PATCH] Fix #485 where empty email throws "User is already registered" --- rest_auth/registration/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 4f99c18..972cf62 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -129,7 +129,7 @@ class SocialLoginSerializer(serializers.Serializer): # with the same email address: raise an exception. # This needs to be handled in the frontend. We can not just # 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? account_exists = get_user_model().objects.filter( email=login.user.email,