Merge pull request 'UPDATE' (#98) from shaxob into main
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m51s

Reviewed-on: #98
This commit is contained in:
2026-04-24 12:27:09 +00:00
3 changed files with 5 additions and 4 deletions

View File

@@ -1,9 +1,10 @@
from django.db import models from django.db import models
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django_core.models import AbstractBaseModel
from pydantic import BaseModel from pydantic import BaseModel
class PermissionToAction(BaseModel): class PermissionToAction(AbstractBaseModel):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
code = models.CharField(max_length=100, unique=True) code = models.CharField(max_length=100, unique=True)
@@ -15,7 +16,7 @@ class PermissionToAction(BaseModel):
verbose_name_plural = _('Harakatlar uchun ruxsatnomalar') verbose_name_plural = _('Harakatlar uchun ruxsatnomalar')
class PermissionToTab(BaseModel): class PermissionToTab(AbstractBaseModel):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
code = models.CharField(max_length=100, unique=True) code = models.CharField(max_length=100, unique=True)
permission_to_actions = models.ManyToManyField( permission_to_actions = models.ManyToManyField(
@@ -30,7 +31,7 @@ class PermissionToTab(BaseModel):
verbose_name_plural = _("Bo'lim uchun ruxsatnomalar") verbose_name_plural = _("Bo'lim uchun ruxsatnomalar")
class Permission(BaseModel): class Permission(AbstractBaseModel):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
code = models.CharField(max_length=100, unique=True) code = models.CharField(max_length=100, unique=True)
permission_tab = models.ManyToManyField(PermissionToTab, related_name='permissions') permission_tab = models.ManyToManyField(PermissionToTab, related_name='permissions')

View File

@@ -1,9 +1,9 @@
from django.contrib.auth import models as auth_models from django.contrib.auth import models as auth_models
from django.db import models from django.db import models
from .permission import Role
from ..choices import RoleChoice from ..choices import RoleChoice
from ..managers import UserManager from ..managers import UserManager
from ...evaluation.permissions.permission import Role
class User(auth_models.AbstractUser): class User(auth_models.AbstractUser):

View File