Skip to content

Commit 327a383

Browse files
committed
B: Still save nodetree as json when no import because non-sideeffected
1 parent f5bd790 commit 327a383

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opsi/webserver/serialize.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ def _remove_unneeded_nodes(program, nodetree: NodeTreeN):
384384

385385
# Finally, remove those nodes that weren't visited
386386
nodes = [node for node in nodetree.nodes if node.id in visited]
387-
nodetree.nodes = nodes
387+
388+
# make a copy of nodetree to fix broken json save
389+
nodetree = NodeTreeN(nodes=nodes)
388390

389391
return nodetree
390392

0 commit comments

Comments
 (0)