Perm for assets (#3003)

* [Update] 授权显示节点下所有的资产

* [Update] 修改返回资产的comment

* [Update] 修改节点返回字段
pull/3004/head
老广 2019-07-22 11:38:09 +08:00 committed by GitHub
parent a8af4e8804
commit 5f59c729b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -14,13 +14,14 @@ __all__ = [
class NodeSerializer(BulkOrgResourceModelSerializer):
assets_amount = serializers.IntegerField(read_only=True)
name = serializers.ReadOnlyField(source='value')
class Meta:
model = Node
only_fields = ['id', 'key', 'value', 'org_id']
fields = only_fields + ['assets_amount']
fields = only_fields + ['name', 'assets_amount']
read_only_fields = [
'key', 'assets_amount', 'org_id',
'key', 'name', 'assets_amount', 'org_id',
]
def validate_value(self, data):