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

pull/9415/head
Bai 2023-02-02 16:06:15 +08:00 committed by Jiangjie.Bai
parent be151523f4
commit a045eb9936
4 changed files with 19 additions and 2 deletions

View File

@ -13,7 +13,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='playbook', model_name='playbook',
name='create_method', 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( migrations.AddField(
model_name='playbook', model_name='playbook',

View File

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

View File

@ -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'},
),
]

View File

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