Skip to content

Commit

Permalink
make sure we remove deleted nodes from new_nodes and simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
oroulet committed Feb 1, 2019
1 parent 3f2c1fa commit 10f54e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions uamodeler/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ def __init__(self, modeler):

def delete_node(self, node):
if node:
nodes = get_node_children(node)
for n in nodes:
n.delete(delete_references=True, recursive=True)
if n in self.new_nodes:
self.new_nodes.remove(n)
deleted_nodes = node.delete(delete_references=True, recursive=True)
for dn in deleted_nodes:
if dn in self.new_nodes:
self.new_nodes.remove(dn)
self.modeler.tree_ui.remove_current_item()

def paste_node(self, node):
Expand Down

0 comments on commit 10f54e7

Please sign in to comment.