mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Job Template Page-new JT w/ no survey
Fixed a defect where the UI would attempt to save a survey spec even if survey_enabled=false
This commit is contained in:
parent
f5c21be02f
commit
0bfe5dc6ba
@ -339,18 +339,21 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
||||
.success(function(data) {
|
||||
$scope.$emit('templateSaveSuccess', data);
|
||||
|
||||
//once the job template information is saved we submit the survey info to the correct endpoint
|
||||
var url = data.url+ 'survey_spec/';
|
||||
Rest.setUrl(url);
|
||||
Rest.post({ name: $scope.survey_name, description: $scope.survey_description, spec: $scope.survey_questions })
|
||||
.success(function () {
|
||||
Wait('stop');
|
||||
if(data.survey_enabled===true){
|
||||
//once the job template information is saved we submit the survey info to the correct endpoint
|
||||
var url = data.url+ 'survey_spec/';
|
||||
Rest.setUrl(url);
|
||||
Rest.post({ name: $scope.survey_name, description: $scope.survey_description, spec: $scope.survey_questions })
|
||||
.success(function () {
|
||||
Wait('stop');
|
||||
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to add new survey. Post returned status: ' + status });
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to add new survey. Post returned status: ' + status });
|
||||
});
|
||||
|
||||
})
|
||||
.error(function (data, status) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user