perf: asset tree search

pull/9404/head
feng 2023-02-02 10:41:03 +08:00 committed by Jiangjie.Bai
parent d68ed57eb9
commit 0aa681620f
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ class NodeChildrenAsTreeApi(SerializeToTreeNodeMixin, NodeChildrenApi):
query_all = self.request.query_params.get("all", "0") == "all" query_all = self.request.query_params.get("all", "0") == "all"
include_assets = self.request.query_params.get('assets', '0') == '1' include_assets = self.request.query_params.get('assets', '0') == '1'
if not self.instance or not include_assets: if not self.instance or not include_assets:
return [] return Asset.objects.none()
if query_all: if query_all:
assets = self.instance.get_all_assets_for_tree() assets = self.instance.get_all_assets_for_tree()
else: else: