Fix null on workflowjobtemplate (#11522)

Fix null on workflowjobtemplate

See: https://github.com/ansible/awx/issues/11284
This commit is contained in:
Kersom 2022-01-18 16:54:00 -05:00 committed by GitHub
parent da930ce276
commit 495394084d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -23,11 +23,13 @@ function WorkflowJobTemplateAdd() {
organization,
webhook_credential,
webhook_key,
limit,
...templatePayload
} = values;
templatePayload.inventory = inventory?.id;
templatePayload.organization = organization?.id;
templatePayload.webhook_credential = webhook_credential?.id;
templatePayload.limit = limit === '' ? null : limit;
const organizationId =
organization?.id || inventory?.summary_fields?.organization.id;
try {

View File

@ -113,7 +113,7 @@ describe('<WorkflowJobTemplateAdd/>', () => {
description: '',
extra_vars: '---',
inventory: undefined,
limit: '',
limit: null,
organization: undefined,
scm_branch: '',
webhook_credential: undefined,

View File

@ -22,11 +22,13 @@ function WorkflowJobTemplateEdit({ template }) {
organization,
webhook_credential,
webhook_key,
limit,
...templatePayload
} = values;
templatePayload.inventory = inventory?.id || null;
templatePayload.organization = organization?.id || null;
templatePayload.webhook_credential = webhook_credential?.id || null;
templatePayload.limit = limit === '' ? null : limit;
const formOrgId =
organization?.id || inventory?.summary_fields?.organization.id || null;