fix(perms): 未激活资产不能使用

pull/4783/head^2
xinwen 2020-10-13 15:50:11 +08:00
parent f3d052554d
commit 373c6c77e0
2 changed files with 2 additions and 1 deletions

View File

@ -60,6 +60,7 @@ class SerializeToTreeNodeMixin:
'isParent': False, 'isParent': False,
'open': False, 'open': False,
'iconSkin': self.get_platform(asset), 'iconSkin': self.get_platform(asset),
'chkDisabled': not asset.is_active,
'meta': { 'meta': {
'type': 'asset', 'type': 'asset',
'asset': { 'asset': {

View File

@ -75,7 +75,7 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
model = Asset model = Asset
only_fields = [ only_fields = [
"id", "hostname", "ip", "protocols", "os", 'domain', "id", "hostname", "ip", "protocols", "os", 'domain',
"platform", "comment", "org_id", "platform", "comment", "org_id", "is_active"
] ]
fields = only_fields + ['org_name'] fields = only_fields + ['org_name']
read_only_fields = fields read_only_fields = fields