Bugfixes from testrun
This commit is contained in:
parent
bbadfa2251
commit
6d839d5cc7
11
cps/editbooks.py
Normal file → Executable file
11
cps/editbooks.py
Normal file → Executable file
|
@ -357,7 +357,16 @@ def delete_book_from_table(book_id, book_format, jsonResponse):
|
|||
else:
|
||||
# book not found
|
||||
log.error('Book with id "%s" could not be deleted: not found', book_id)
|
||||
return render_delete_book_result(book_format, jsonResponse, warning, book_id)
|
||||
return render_delete_book_result(book_format, jsonResponse, warning, book_id)
|
||||
message = _("You are missing permissions to delete books")
|
||||
if jsonResponse:
|
||||
return json.dumps({"location": url_for("editbook.edit_book", book_id=book_id),
|
||||
"type": "danger",
|
||||
"format": "",
|
||||
"message": message})
|
||||
else:
|
||||
flash(message, category="error")
|
||||
return redirect(url_for('editbook.edit_book', book_id=book_id))
|
||||
|
||||
|
||||
def render_edit_book(book_id):
|
||||
|
|
5
cps/static/js/main.js
Normal file → Executable file
5
cps/static/js/main.js
Normal file → Executable file
|
@ -198,7 +198,7 @@ function confirmDialog(id, dialogid, dataValue, yesFn, noFn) {
|
|||
$confirm.modal('show');
|
||||
}
|
||||
|
||||
$("#delete_confirm").click(function() {
|
||||
$("#delete_confirm").click(function(event) {
|
||||
//get data-id attribute of the clicked element
|
||||
var deleteId = $(this).data("delete-id");
|
||||
var bookFormat = $(this).data("delete-format");
|
||||
|
@ -228,8 +228,7 @@ $("#delete_confirm").click(function() {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
window.location.href = getPath() + "/delete/" + deleteId;
|
||||
|
||||
postButton(event, getPath() + "/delete/" + deleteId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user