From edb2d1bd7bde8124c4cd22c1ca5fa06add65473b Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Mon, 25 Dec 2023 16:49:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=88=91=E7=9A=84=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=87=E7=AD=BE=E4=BF=A1=E6=81=AF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/serializers/user_permission.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/perms/serializers/user_permission.py b/apps/perms/serializers/user_permission.py index 9f7f89cee..0bd9bdc02 100644 --- a/apps/perms/serializers/user_permission.py +++ b/apps/perms/serializers/user_permission.py @@ -10,6 +10,7 @@ from assets.const import Category, AllTypes from assets.models import Node, Asset, Platform from assets.serializers.asset.common import AssetLabelSerializer, AssetProtocolsPermsSerializer from common.serializers.fields import ObjectRelatedField, LabeledChoiceField +from common.serializers import ResourceLabelsMixin from orgs.mixins.serializers import OrgResourceModelSerializerMixin from perms.serializers.permission import ActionChoicesField @@ -19,12 +20,11 @@ __all__ = [ ] -class AssetPermedSerializer(OrgResourceModelSerializerMixin): +class AssetPermedSerializer(OrgResourceModelSerializerMixin, ResourceLabelsMixin): """ 被授权资产的数据结构 """ platform = ObjectRelatedField(required=False, queryset=Platform.objects, label=_('Platform')) category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category')) type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type')) - labels = AssetLabelSerializer(many=True, required=False, label=_('Label')) domain = ObjectRelatedField(required=False, queryset=Node.objects, label=_('Domain')) class Meta: