From 185bd6a441af53fefec2426a891df0a1d140af58 Mon Sep 17 00:00:00 2001 From: Utkarsh Tripathi <83540694+utkarsh-1905@users.noreply.github.com> Date: Tue, 14 May 2024 18:42:57 +0530 Subject: [PATCH] fix: changed the error message from custom_auth serializer (#3924) Signed-off-by: Utkarsh Tripathi --- api/custom_auth/serializers.py | 2 +- api/tests/unit/custom_auth/test_unit_custom_auth_serializer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/custom_auth/serializers.py b/api/custom_auth/serializers.py index fe680fb5af35..55bb43e595ae 100644 --- a/api/custom_auth/serializers.py +++ b/api/custom_auth/serializers.py @@ -40,7 +40,7 @@ class Meta(UserCreateSerializer.Meta): UniqueValidator( queryset=FFAdminUser.objects.all(), lookup="iexact", - message="Invalid email address.", + message="Email already exists. Please log in.", ) ] } diff --git a/api/tests/unit/custom_auth/test_unit_custom_auth_serializer.py b/api/tests/unit/custom_auth/test_unit_custom_auth_serializer.py index a00089baaed2..127f5569a3b9 100644 --- a/api/tests/unit/custom_auth/test_unit_custom_auth_serializer.py +++ b/api/tests/unit/custom_auth/test_unit_custom_auth_serializer.py @@ -28,7 +28,7 @@ def test_CustomUserCreateSerializer_does_case_insensitive_lookup_with_email(db): # When assert serializer.is_valid() is False - assert serializer.errors["email"][0] == "Invalid email address." + assert serializer.errors["email"][0] == "Email already exists. Please log in." def test_CustomUserCreateSerializer_calls_is_authentication_method_valid_correctly_if_auth_controller_is_installed(