home · contact · privacy
Make explicit ProcessSteps overwrite implicit ones.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 5 Jun 2024 18:02:32 +0000 (20:02 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 5 Jun 2024 18:02:32 +0000 (20:02 +0200)
plomtask/processes.py

index bfadc2bf9760166987fc6b52b13290f6811a02aa..089a7105fddcd9228dbaebcfd3c6313e3ff57f6b 100644 (file)
@@ -93,6 +93,13 @@ class Process(BaseModel[int], ConditionsRelations):
             for child in explicit_children:
                 assert isinstance(child.id_, int)
                 node.steps[child.id_] = make_node(child)
+                # ensure that one (!) explicit step of process replaces
+                # one (!) implicit step of same process
+                for i in [i for i, s in node.steps.items()
+                          if not s.is_explicit
+                          and s.process.id_ == child.step_process_id]:
+                    del node.steps[i]
+                    break
             node.seen = node_id in seen_step_ids
             seen_step_ids.add(node_id)
             for id_, step in node.steps.items():