Merge pull request #8814 from netchampfaris/file-uploader-403

fix(fileuploader): Handle 403 status code
This commit is contained in:
mergify[bot] 2019-11-14 07:33:36 +00:00 committed by GitHub
commit d74faae430
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -367,6 +367,13 @@ export default {
if (this.on_success) {
this.on_success(file_doc, r);
}
} else if (xhr.status === 403) {
let response = JSON.parse(xhr.responseText);
frappe.msgprint({
title: __('Not permitted'),
indicator: 'red',
message: response._error_message
});
} else {
file.failed = true;
let error = null;