mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 17:48:10 -03:30
remove relationship in view if cycle detected
This commit is contained in:
@@ -2951,12 +2951,12 @@ class WorkflowJobTemplateNodeChildrenBaseList(WorkflowsEnforcementMixin, Enforce
|
||||
|
||||
parent_node_type_relationship = getattr(parent, self.relationship)
|
||||
parent_node_type_relationship.add(sub)
|
||||
parent.save()
|
||||
|
||||
graph = WorkflowDAG(parent.workflow_job_template)
|
||||
if graph.has_cycle():
|
||||
parent_node_type_relationship.remove(sub)
|
||||
return {"Error": _("Cycle detected.")}
|
||||
parent_node_type_relationship.remove(sub)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user