mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 21:27: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
|
from apps.core.models import BaseModel
|
||||||
|
|
||||||
|
|
||||||
class UserRole(models.Choices):
|
class UserRole(models.TextChoices):
|
||||||
STUDENT = "student"
|
STUDENT = "student", "Участник соревнований"
|
||||||
METODIST = "metodist"
|
METODIST = "metodist", "Методист (составитель заданий)"
|
||||||
|
|
||||||
|
|
||||||
class User(BaseModel):
|
class User(BaseModel):
|
||||||
@@ -29,7 +29,8 @@ class User(BaseModel):
|
|||||||
return check_password(self.password, password)
|
return check_password(self.password, password)
|
||||||
|
|
||||||
status = models.CharField(
|
status = models.CharField(
|
||||||
max_length=10, choices=UserRole, default="student"
|
max_length=10, choices=UserRole.choices, default="student",
|
||||||
|
verbose_name="роль участника"
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user