django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

Failed to run with the lates allauth lib

Open Mixser opened this issue 2 years ago • 2 comments

The allauth.utils module no longer contains the email_address_exists function (see commit: https://github.com/pennersr/django-allauth/commit/9fccdd08eacc2be9dcd284bc7edce9de692c5543). Consequently, this leads to that we are unable to run with the latest version of the Allauth library due to the absence of the email_address_exists function in the allauth.utils module.


ImportError: allauth needs to be added to INSTALLED_APPS.

at this line https://github.com/Tivix/django-rest-auth/blob/cdd04aa9be7ad3da6b417380ee14b3ff4d5459ba/rest_auth/registration/serializers.py#L7

Mixser avatar Nov 12 '23 21:11 Mixser

my understanding is that this package is no longer maintained. You should be able to replace this with dj-rest-auth :

https://github.com/iMerica/dj-rest-auth

lingster avatar Mar 14 '24 12:03 lingster

This is a workaround

from allauth.account.models import EmailAddress

def email_exists(email):
    return EmailAddress.objects.filter(email=email).exists()

pranav-sharma-au5 avatar Apr 24 '24 07:04 pranav-sharma-au5