Skip to content

Commit

Permalink
fix bug when reverting non-default inventory prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemcdermott committed Nov 19, 2018
1 parent 951515d commit b74597f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions awx/ui/client/src/templates/prompt/prompt.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit b74597f

Please sign in to comment.