"""Translated display names and error messages of the users module.""" from django.utils.translation import gettext_lazy as _ from apps.users.domain.enums import Role ROLE_LABELS = { Role.ADMIN: _("Admin"), Role.MANAGEMENT: _("Management"), Role.EMPLOYEE: _("Employee"), Role.INTERN: _("Intern"), Role.SUBCONTRACTOR: _("Subcontractor"), } ROLE_CHOICES = [(role.value, label) for role, label in ROLE_LABELS.items()] ERROR_MESSAGES = { "invalid_name": _("Enter a name (at most 150 characters)."), "invalid_email": _("Enter a valid email address."), "email_taken": _("A user with this email address already exists."), "intern_requires_end_date": _("An intern must have an end date."), "intern_requires_supervisor": _("An intern must have a supervisor."), "invalid_supervisor": _("The supervisor must be an active management or employee user."), "last_active_admin": _( "This is the last active admin. It cannot be deactivated or moved to another role." ), "supervisor_has_interns": _( "This user supervises active interns. Change their supervisor first." ), "user_not_found": _("The user was not found."), "*": _("The change could not be saved."), }