diff --git a/apps/assets/models/node.py b/apps/assets/models/node.py index 72000d9f1..20104412b 100644 --- a/apps/assets/models/node.py +++ b/apps/assets/models/node.py @@ -491,6 +491,8 @@ class Node(OrgModelMixin, SomeNodesMixin, FamilyMixin, NodeAssetsMixin): sort_key_func = lambda n: [int(i) for i in n.key.split(':')] nodes_sorted = sorted(list(nodes), key=sort_key_func) nodes_mapper = {n.key: n for n in nodes_sorted} + # 更新自己时,自己的parent_key获取不到 + nodes_mapper.update({self.parent_key: self.parent}) for node in nodes_sorted: parent = nodes_mapper.get(node.parent_key) if not parent: