[Bugfix] 修复资产数量不对的bug

This commit is contained in:
ibuler
2018-08-10 14:46:04 +08:00
parent 7da46354ca
commit 6b86b8b485
6 changed files with 15 additions and 14 deletions

View File

@@ -68,7 +68,7 @@ class NodeSerializer(serializers.ModelSerializer):
@staticmethod
def get_assets_amount(obj):
return obj.assets__count if hasattr(obj, 'assets__count') else 0
return obj.get_all_assets().count()
@staticmethod
def get_tree_id(obj):