Skip to content

Commit

Permalink
Make all_parents_must_converge settable when creating node
Browse files Browse the repository at this point in the history
When targeting, ../workflow_job_templates/id#/workflow_nodes/ endpoint,
user could not set all_parents_must_converge to true.

awx issue ansible#7063
  • Loading branch information
fosterseth committed Jun 8, 2020
1 parent e5ec761 commit 3c1de9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3600,7 +3600,7 @@ def validate(self, attrs):
ujt = self.instance.unified_job_template
if ujt is None:
ret = {}
for fd in ('workflow_job_template', 'identifier'):
for fd in ('workflow_job_template', 'identifier', 'all_parents_must_converge'):
if fd in attrs:
ret[fd] = attrs[fd]
return ret
Expand Down
12 changes: 12 additions & 0 deletions awx/main/tests/functional/api/test_workflow_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ def test_node_accepts_prompted_fields(inventory, project, workflow_job_template,
user=admin_user, expect=201)


@pytest.mark.django_db
@pytest.mark.parametrize("field_name, field_value", [
('all_parents_must_converge', True),
('all_parents_must_converge', False),
])
def test_create_node_with_field(field_name, field_value, workflow_job_template, post, admin_user):
url = reverse('api:workflow_job_template_workflow_nodes_list',
kwargs={'pk': workflow_job_template.pk})
res = post(url, {field_name: field_value}, user=admin_user)
assert res.data[field_name] == field_value


@pytest.mark.django_db
class TestApprovalNodes():
def test_approval_node_creation(self, post, approval_node, admin_user):
Expand Down

0 comments on commit 3c1de9e

Please sign in to comment.