From a045eb99361a458eccb8b5436a9b3e012b8708f1 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 2 Feb 2023 16:06:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/migrations/0025_auto_20230117_1130.py | 2 +- apps/rbac/api/role.py | 1 - apps/rbac/migrations/0012_alter_role_options.py | 17 +++++++++++++++++ apps/rbac/models/role.py | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 apps/rbac/migrations/0012_alter_role_options.py diff --git a/apps/ops/migrations/0025_auto_20230117_1130.py b/apps/ops/migrations/0025_auto_20230117_1130.py index b6d3881e7..7a5aa33b8 100644 --- a/apps/ops/migrations/0025_auto_20230117_1130.py +++ b/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', diff --git a/apps/rbac/api/role.py b/apps/rbac/api/role.py index 0a4d52706..255299516 100644 --- a/apps/rbac/api/role.py +++ b/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 diff --git a/apps/rbac/migrations/0012_alter_role_options.py b/apps/rbac/migrations/0012_alter_role_options.py new file mode 100644 index 000000000..ba98b699e --- /dev/null +++ b/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'}, + ), + ] diff --git a/apps/rbac/models/role.py b/apps/rbac/models/role.py index 1eff7c15c..e5a18b5e6 100644 --- a/apps/rbac/models/role.py +++ b/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):