fix(serializers): PRWLR-4869 hide email address information when it already exists (#60)

* fix(serializers): PRWLR-4869 hide email address information when it already exists

* fix(serializers): PRWLR-4869 fix ruff format error
This commit is contained in:
Adrián Jesús Peña Rodríguez authored and GitHub committed 2024-10-28 15:11:20 +01:00
1 parent 674a38e80f
commit 98ec0532b2
3 files changed
+48 -2

No files matched your search

+6 -1
View File
@@ -69,7 +69,12 @@ class StateChoices(models.TextChoices):
class User(AbstractBaseUser):
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
name = models.CharField(max_length=150, validators=[MinLengthValidator(3)])
email = models.EmailField(max_length=254, unique=True, help_text="Case insensitive")
email = models.EmailField(
max_length=254,
unique=True,
help_text="Case insensitive",
error_messages={"unique": "Please check the email address and try again."},
)
company_name = models.CharField(max_length=150, blank=True)
is_active = models.BooleanField(default=True)
date_joined = models.DateTimeField(auto_now_add=True, editable=False)