mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
remove relationship in view if cycle detected
This commit is contained in:
parent
9afc38b714
commit
2f9dc4d075
@ -2959,12 +2959,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
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user