From 519e0eac01be900ba50176b58b72af48ded184ae Mon Sep 17 00:00:00 2001 From: Bai Date: Sun, 4 Dec 2022 20:51:22 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20CommandGroupSerial?= =?UTF-8?q?izer=20type=20=E5=AD=97=E6=AE=B5=E4=B8=BA=20LabeledChoiceField?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/acls/serializers/command_acl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/acls/serializers/command_acl.py b/apps/acls/serializers/command_acl.py index 4e0d3edaa..0accb5f56 100644 --- a/apps/acls/serializers/command_acl.py +++ b/apps/acls/serializers/command_acl.py @@ -1,8 +1,7 @@ from django.utils.translation import ugettext_lazy as _ -from rest_framework import serializers from acls.models import CommandGroup, CommandFilterACL -from common.drf.fields import ObjectRelatedField +from common.drf.fields import ObjectRelatedField, LabeledChoiceField from orgs.mixins.serializers import BulkOrgResourceModelSerializer from .base import BaseUserAssetAccountACLSerializerMixin as BaseSerializer @@ -10,7 +9,7 @@ __all__ = ["CommandFilterACLSerializer", "CommandGroupSerializer"] class CommandGroupSerializer(BulkOrgResourceModelSerializer): - type = serializers.ChoiceField( + type = LabeledChoiceField( choices=CommandGroup.TypeChoices.choices, default=CommandGroup.TypeChoices.command, label=_('Type') )