1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-25 02:57:22 +00:00

Prevent local variable 'from_book' referenced before assignment during merge of books

Merge books source book: Each book in own row
Merge books, sources are deleted before dialog shows up again
This commit is contained in:
Ozzie Isaacs 2022-03-09 14:45:39 +01:00
parent 753319c8b6
commit 34478079d8
2 changed files with 3 additions and 2 deletions

View File

@ -1263,8 +1263,8 @@ def simulate_merge_list_book():
to_book = calibre_db.get_book(vals[0]).title
vals.pop(0)
if to_book:
for book_id in vals:
from_book = []
for book_id in vals:
from_book.append(calibre_db.get_book(book_id).title)
return json.dumps({'to': to_book, 'from': from_book})
return ""

View File

@ -107,8 +107,9 @@ $(function() {
url: window.location.pathname + "/../ajax/simulatemerge",
data: JSON.stringify({"Merge_books":selections}),
success: function success(booTitles) {
$('#merge_from').empty();
$.each(booTitles.from, function(i, item) {
$("<span>- " + item + "</span>").appendTo("#merge_from");
$("<span>- " + item + "</span><p></p>").appendTo("#merge_from");
});
$("#merge_to").text("- " + booTitles.to);