mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 23:46:05 -03:30
Merge pull request #4645 from chrismeyersfsu/fix-3245
gracefully handle 409 on delete
This commit is contained in:
@@ -198,6 +198,8 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
|
|||||||
msg += 'Please contact your system administrator.';
|
msg += 'Please contact your system administrator.';
|
||||||
}
|
}
|
||||||
Alert(defaultMsg.hdr, msg);
|
Alert(defaultMsg.hdr, msg);
|
||||||
|
} else if (status === 409) {
|
||||||
|
Alert('Conflict', data.conflict || "Resource currently in use.");
|
||||||
} else if (status === 410) {
|
} else if (status === 410) {
|
||||||
Alert('Deleted Object', 'The requested object was previously deleted and can no longer be accessed.');
|
Alert('Deleted Object', 'The requested object was previously deleted and can no longer be accessed.');
|
||||||
} else if ((status === 'Token is expired') || (status === 401 && data.detail && data.detail === 'Token is expired') ||
|
} else if ((status === 'Token is expired') || (status === 401 && data.detail && data.detail === 'Token is expired') ||
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest',
|
|||||||
handleSuccessfulDelete();
|
handleSuccessfulDelete();
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($scope, data, data.status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to delete workflow job template failed. DELETE returned status: ' + status });
|
msg: 'Call to delete workflow job template failed. DELETE returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -141,8 +141,8 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest',
|
|||||||
handleSuccessfulDelete();
|
handleSuccessfulDelete();
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($scope, data, data.status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to delete job template failed. DELETE returned status: ' + status });
|
msg: 'Call to delete job template failed. DELETE returned status: ' + data.status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user