fix bug when reverting non-default inventory prompts

This commit is contained in:
Jake McDermott 2018-11-19 15:17:28 -05:00
parent 951515da2f
commit b74597f4dd
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7

View File

@ -180,6 +180,17 @@ function PromptService (Empty, $filter) {
});
}
if (_.get(promptData, 'templateType') === 'workflow_job_template') {
if (_.get(launchData, 'inventory_id', null) === null) {
// It's possible to get here on a workflow job template with an inventory prompt and no
// default value by selecting an inventory, removing it, selecting a different inventory,
// and then reverting. A null inventory_id may be accepted by the API for prompted workflow
// inventories in the future, but for now they will 400. As such, we intercept that case here
// and remove it from the request data prior to launching.
delete launchData.inventory_id;
}
}
return launchData;
};