|
|
@ -613,14 +613,15 @@ def edit_book(book_id):
|
|
|
|
|
|
|
|
|
|
|
|
if not error:
|
|
|
|
if not error:
|
|
|
|
if "cover_url" in to_save:
|
|
|
|
if "cover_url" in to_save:
|
|
|
|
if not current_user.role_upload() and to_save["cover_url"] != "":
|
|
|
|
if to_save["cover_url"]:
|
|
|
|
return "", (403)
|
|
|
|
if not current_user.role_upload():
|
|
|
|
result, error = helper.save_cover_from_url(to_save["cover_url"], book.path)
|
|
|
|
return "", (403)
|
|
|
|
if result is True:
|
|
|
|
result, error = helper.save_cover_from_url(to_save["cover_url"], book.path)
|
|
|
|
book.has_cover = 1
|
|
|
|
if result is True:
|
|
|
|
modif_date = True
|
|
|
|
book.has_cover = 1
|
|
|
|
else:
|
|
|
|
modif_date = True
|
|
|
|
flash(error, category="error")
|
|
|
|
else:
|
|
|
|
|
|
|
|
flash(error, category="error")
|
|
|
|
|
|
|
|
|
|
|
|
# Add default series_index to book
|
|
|
|
# Add default series_index to book
|
|
|
|
modif_date |= edit_book_series_index(to_save["series_index"], book)
|
|
|
|
modif_date |= edit_book_series_index(to_save["series_index"], book)
|
|
|
|