From 8064eb9cbaa893720c7050fd07b29d4b2785e052 Mon Sep 17 00:00:00 2001 From: Timur Date: Mon, 3 Mar 2025 11:21:53 +0300 Subject: [PATCH] add verbose names to user roles and user status --- services/backend/apps/user/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/backend/apps/user/models.py b/services/backend/apps/user/models.py index c1df2f1..598abb6 100644 --- a/services/backend/apps/user/models.py +++ b/services/backend/apps/user/models.py @@ -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: