mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 02:47:10 +00:00
add verbose names to user roles and user status
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user