mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02: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 = getattr(parent, self.relationship)
|
||||||
parent_node_type_relationship.add(sub)
|
parent_node_type_relationship.add(sub)
|
||||||
parent.save()
|
|
||||||
|
|
||||||
graph = WorkflowDAG(parent.workflow_job_template)
|
graph = WorkflowDAG(parent.workflow_job_template)
|
||||||
if graph.has_cycle():
|
if graph.has_cycle():
|
||||||
parent_node_type_relationship.remove(sub)
|
parent_node_type_relationship.remove(sub)
|
||||||
return {"Error": _("Cycle detected.")}
|
return {"Error": _("Cycle detected.")}
|
||||||
|
parent_node_type_relationship.remove(sub)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user