[core] Graph: add missing GraphModification

In `initFromTemplate`, ensure that Publish nodes removal are grouped
under the same graph modification to trigger updates only once.
This commit is contained in:
Yann Lanthony 2025-02-06 16:46:05 +01:00
parent 25094ac877
commit 724e7fb387

View file

@ -258,8 +258,9 @@ class Graph(BaseObject):
self._deserialize(Graph._loadGraphData(filepath))
if not publishOutputs:
for node in [node for node in self.nodes if node.nodeType == "Publish"]:
self.removeNode(node.name)
with GraphModification(self):
for node in [node for node in self.nodes if node.nodeType == "Publish"]:
self.removeNode(node.name)
@staticmethod
def _loadGraphData(filepath: PathLike) -> dict: