mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-12 21:39:18 +00:00
perf: 修改 CommandGroupSerializer type 字段为 LabeledChoiceField
This commit is contained in:
@@ -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')
|
||||
)
|
||||
|
Reference in New Issue
Block a user