mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 09:06:40 +03:00
Fix #485 where empty email throws "User is already registered"
This commit is contained in:
parent
624ad01afb
commit
38b9c65680
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user