File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1526,17 +1526,19 @@ def _delete_node_cascade(self, node: Node) -> None:
15261526 for n in children :
15271527 for parent in root_graph .predecessors (n ):
15281528 if parent != node .id and parent not in children :
1529- # Found a parent outside the to be deleted subtree, keep this child
1529+ # Found a parent outside the to-be- deleted subtree, keep this child
15301530 break
15311531 else :
1532+ # All parents are in the to-be-deleted subtree, nuke it
15321533 delete_list .append (n )
15331534
15341535 self .logger .info (
15351536 f"Deleting { len (delete_list )} descendants of node { node .id } with no other parents"
15361537 )
15371538 with self .beh .transaction ():
1539+ # Update all references while the node is still alive, then delete all
1540+ # descendants with no outside parents
15381541 self ._on_node_delete (node .id )
1539-
15401542 for n in reversed (delete_list ):
15411543 self .beh .delete_object (n )
15421544
You can’t perform that action at this time.
0 commit comments