♻️(models) refactor user email fields

The email field on the user is renamed to "admin_email" for clarity. The
"email" and "name" fields of user's main identity are made available on
the user model so it is easier to access it.
This commit is contained in:
Samuel Paccoud - DINUM
2024-03-25 23:56:32 +01:00
committed by Marie
parent 6d807113bc
commit 7ea6342a01
12 changed files with 113 additions and 83 deletions

View File

@@ -120,13 +120,13 @@ class ContactFactory(BaseContactFactory):
class UserFactory(factory.django.DjangoModelFactory):
"""A factory to random users for testing purposes."""
"""A factory to create random users for testing purposes."""
class Meta:
model = models.User
django_get_or_create = ("email",)
django_get_or_create = ("admin_email",)
email = factory.Faker("email")
admin_email = factory.Faker("email")
language = factory.fuzzy.FuzzyChoice([lang[0] for lang in settings.LANGUAGES])
password = make_password("password")