Browse Source

fix: 修改角色列表排序问题

pull/9415/head
Bai 2 years ago committed by Jiangjie.Bai
parent
commit
a045eb9936
  1. 2
      apps/ops/migrations/0025_auto_20230117_1130.py
  2. 1
      apps/rbac/api/role.py
  3. 17
      apps/rbac/migrations/0012_alter_role_options.py
  4. 1
      apps/rbac/models/role.py

2
apps/ops/migrations/0025_auto_20230117_1130.py

@ -13,7 +13,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='playbook',
name='create_method',
field=models.CharField(choices=[('blank', 'Blank'), ('upload', 'Upload'), ('vcs', 'VCS')], default='blank', max_length=128, verbose_name='CreateMethod'),
field=models.CharField(choices=[('blank', 'Blank'), ('vcs', 'VCS')], default='blank', max_length=128, verbose_name='CreateMethod'),
),
migrations.AddField(
model_name='playbook',

1
apps/rbac/api/role.py

@ -4,7 +4,6 @@ from rest_framework.exceptions import PermissionDenied
from rest_framework.decorators import action
from common.api import JMSModelViewSet
from common.api import PaginatedResponseMixin
from ..filters import RoleFilter
from ..serializers import RoleSerializer, RoleUserSerializer
from ..models import Role, SystemRole, OrgRole

17
apps/rbac/migrations/0012_alter_role_options.py

@ -0,0 +1,17 @@
# Generated by Django 3.2.16 on 2023-02-02 08:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rbac', '0011_remove_redundant_permission'),
]
operations = [
migrations.AlterModelOptions(
name='role',
options={'ordering': ('scope', 'name'), 'verbose_name': 'Role'},
),
]

1
apps/rbac/models/role.py

@ -43,6 +43,7 @@ class Role(JMSBaseModel):
class Meta:
unique_together = [('name', 'scope')]
ordering = ('scope', 'name')
verbose_name = _('Role')
def __str__(self):

Loading…
Cancel
Save