mirror of https://github.com/jumpserver/jumpserver
fix: 授权资产列表 platform 应该显示名称
parent
32e2d19553
commit
8da4027e32
|
@ -23,4 +23,3 @@ urlpatterns = [
|
|||
]
|
||||
|
||||
urlpatterns += router.urls
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
from rest_framework import serializers
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from assets.models import Node, SystemUser, Asset
|
||||
from assets.models import Node, SystemUser, Asset, Platform
|
||||
from assets.serializers import ProtocolsField
|
||||
from perms.serializers.asset.permission import ActionsField
|
||||
|
||||
|
@ -39,7 +39,9 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
|
|||
被授权资产的数据结构
|
||||
"""
|
||||
protocols = ProtocolsField(label=_('Protocols'), required=False, read_only=True)
|
||||
platform = serializers.ReadOnlyField(source='platform_base')
|
||||
platform = serializers.SlugRelatedField(
|
||||
slug_field='name', queryset=Platform.objects.all(), label=_("Platform")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Asset
|
||||
|
|
Loading…
Reference in New Issue