fix(perms): 修复一次性获取所有资产与节点sql泛滥问题

pull/4783/head
xinwen 2020-10-14 15:40:22 +08:00 committed by 老广
parent 52f1dcf662
commit cfd0098019
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class MyGrantedNodesWithAssetsAsTreeApi(SerializeToTreeNodeMixin, ListAPIView):
all_nodes = get_user_granted_nodes_list_via_mapping_node(user)
all_assets = get_user_granted_all_assets(user)
all_assets = all_assets.annotate(parent_key=F('nodes__key'))
all_assets = all_assets.prefetch_related('platform')
data = [
*self.serialize_nodes(all_nodes, with_asset_amount=True),