rename hardcorded status codes to normal constants at user app

This commit is contained in:
Timur Kh.
2025-03-01 00:42:28 +03:00
parent 23a48e50a0
commit 764511bfa4
2 changed files with 19 additions and 10 deletions
+7
View File
@@ -3,11 +3,18 @@ from django.db import models
from apps.core.models import BaseModel
class UserRole(models.Choices):
STUDENT = "student"
METODIST = "metodist"
class User(BaseModel):
email = models.EmailField(unique=True, verbose_name="Почта")
username = models.SlugField(unique=True, verbose_name="Юзернейм")
password = models.TextField(verbose_name="Пароль")
status = models.CharField(max_length=10, choices=UserRole.choices, default=UserRole.STUDENT)
def __str__(self):
return self.username