Skip to content

Commit

Permalink
chore: update error message for non unique email address (#2662)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Aug 22, 2023
1 parent dad1fa9 commit 49754e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions api/custom_auth/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.conf import settings
from djoser.conf import settings as djoser_settings
from djoser.serializers import UserCreateSerializer, UserDeleteSerializer
from rest_framework import serializers
from rest_framework.authtoken.models import Token
Expand Down Expand Up @@ -36,7 +35,7 @@ class Meta(UserCreateSerializer.Meta):
UniqueValidator(
queryset=FFAdminUser.objects.all(),
lookup="iexact",
message=djoser_settings.CONSTANTS.messages.CANNOT_CREATE_USER_ERROR,
message="Invalid email address.",
)
]
}
Expand Down
2 changes: 1 addition & 1 deletion api/custom_auth/tests/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_CustomUserCreateSerializer_does_case_insensitive_lookup_with_email(db):

# When
assert serializer.is_valid() is False
assert serializer.errors["email"][0].title() == "Unable To Create Account."
assert serializer.errors["email"][0] == "Invalid email address."


def test_CustomUserCreateSerializer_calls_is_authentication_method_valid_correctly_if_auth_controller_is_installed(
Expand Down

1 comment on commit 49754e5

@vercel
Copy link

@vercel vercel bot commented on 49754e5 Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.