add verbose names to user roles and user status

This commit is contained in:
Timur
2025-03-03 11:21:53 +03:00
parent 6877a0cdd1
commit 8064eb9cba
+5 -4
View File
@@ -5,9 +5,9 @@ from apps.achievement.models import Achievement
from apps.core.models import BaseModel
class UserRole(models.Choices):
STUDENT = "student"
METODIST = "metodist"
class UserRole(models.TextChoices):
STUDENT = "student", "Участник соревнований"
METODIST = "metodist", "Методист (составитель заданий)"
class User(BaseModel):
@@ -29,7 +29,8 @@ class User(BaseModel):
return check_password(self.password, password)
status = models.CharField(
max_length=10, choices=UserRole, default="student"
max_length=10, choices=UserRole.choices, default="student",
verbose_name="роль участника"
)
def __str__(self) -> str: