fix: 修复授权树一些问题

This commit is contained in:
xinwen
2021-02-25 14:45:21 +08:00
committed by 老广
parent 5de5fa2e96
commit 1036d1c132
13 changed files with 214 additions and 182 deletions

View File

@@ -337,9 +337,9 @@ class NodeAllAssetsMappingMixin:
t1 = time.time()
with tmp_to_org(org_id):
nodes_id_key = Node.objects.filter(org_id=org_id) \
.annotate(char_id=output_as_string('id')) \
.values_list('char_id', 'key')
nodes_id_key = Node.objects.annotate(
char_id=output_as_string('id')
).values_list('char_id', 'key')
# * 直接取出全部. filter(node__org_id=org_id)(大规模下会更慢)
nodes_assets_id = Asset.nodes.through.objects.all() \