Browse Source

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

pull/4778/head
xinwen 4 years ago committed by 老广
parent
commit
459c5c07c9
  1. 1
      apps/assets/api/mixin.py
  2. 2
      apps/perms/serializers/user_permission.py

1
apps/assets/api/mixin.py

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

2
apps/perms/serializers/user_permission.py

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

Loading…
Cancel
Save