Skip to content

Commit f8cb292

Browse files
committed
refactor(home/api/v1/serializers.py): replace deprecated email_address_exists with assess_unique_email
1 parent 540fe92 commit f8cb292

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

{{cookiecutter.project_slug}}/home/api/v1/serializers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from django.utils.translation import gettext_lazy as _
44
from allauth.account import app_settings as allauth_settings
55
from allauth.account.forms import ResetPasswordForm
6-
from allauth.utils import email_address_exists, generate_unique_username
6+
from allauth.utils import generate_unique_username
7+
from allauth.account.utils import assess_unique_email
78
from allauth.account.adapter import get_adapter
89
from allauth.account.utils import setup_user_email
910
from rest_framework import serializers
@@ -38,7 +39,7 @@ def _get_request(self):
3839
def validate_email(self, email):
3940
email = get_adapter().clean_email(email)
4041
if allauth_settings.UNIQUE_EMAIL:
41-
if email and email_address_exists(email):
42+
if email and assess_unique_email(email):
4243
raise serializers.ValidationError(
4344
_("A user is already registered with this e-mail address.")
4445
)

0 commit comments

Comments
 (0)