mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 14:39:30 -02:30
Merge pull request #2265 from anoek/2076
Display error when trying to delete a job you don't have access to
This commit is contained in:
@@ -156,7 +156,7 @@ export default
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('JobsListUpdate', ['Rest', function(Rest) {
|
.factory('JobsListUpdate', ['Rest', function(Rest) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
@@ -343,9 +343,12 @@ export default
|
|||||||
scope.search(scope.iterator);
|
scope.search(scope.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function() {
|
.error(function(obj, status) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
if (status === 403) {
|
||||||
|
Alert('Error', obj.detail);
|
||||||
|
}
|
||||||
// Ignore the error. The job most likely already finished.
|
// Ignore the error. The job most likely already finished.
|
||||||
// ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
// ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
||||||
// ' failed. POST returned status: ' + status });
|
// ' failed. POST returned status: ' + status });
|
||||||
@@ -361,9 +364,12 @@ export default
|
|||||||
scope.search(scope.iterator);
|
scope.search(scope.iterator);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.error(function () {
|
.error(function (obj, status) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
if (status === 403) {
|
||||||
|
Alert('Error', obj.detail);
|
||||||
|
}
|
||||||
// Ignore the error. The job most likely already finished.
|
// Ignore the error. The job most likely already finished.
|
||||||
//ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
//ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
|
||||||
// ' failed. DELETE returned status: ' + status });
|
// ' failed. DELETE returned status: ' + status });
|
||||||
|
|||||||
Reference in New Issue
Block a user