mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 20:39:59 +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:
parent
753319c8b6
commit
34478079d8
@ -1263,8 +1263,8 @@ def simulate_merge_list_book():
|
|||||||
to_book = calibre_db.get_book(vals[0]).title
|
to_book = calibre_db.get_book(vals[0]).title
|
||||||
vals.pop(0)
|
vals.pop(0)
|
||||||
if to_book:
|
if to_book:
|
||||||
|
from_book = []
|
||||||
for book_id in vals:
|
for book_id in vals:
|
||||||
from_book = []
|
|
||||||
from_book.append(calibre_db.get_book(book_id).title)
|
from_book.append(calibre_db.get_book(book_id).title)
|
||||||
return json.dumps({'to': to_book, 'from': from_book})
|
return json.dumps({'to': to_book, 'from': from_book})
|
||||||
return ""
|
return ""
|
||||||
|
@ -107,8 +107,9 @@ $(function() {
|
|||||||
url: window.location.pathname + "/../ajax/simulatemerge",
|
url: window.location.pathname + "/../ajax/simulatemerge",
|
||||||
data: JSON.stringify({"Merge_books":selections}),
|
data: JSON.stringify({"Merge_books":selections}),
|
||||||
success: function success(booTitles) {
|
success: function success(booTitles) {
|
||||||
|
$('#merge_from').empty();
|
||||||
$.each(booTitles.from, function(i, item) {
|
$.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);
|
$("#merge_to").text("- " + booTitles.to);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user