From 422c1893c09ffb9ebb7e906cae0ca81caf2ebfbd Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Thu, 24 Sep 2020 11:02:12 +0200 Subject: [PATCH] Fix for the fix cover_url --- cps/editbooks.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cps/editbooks.py b/cps/editbooks.py index 7655d104..3127d4a9 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -613,14 +613,15 @@ def edit_book(book_id): if not error: if "cover_url" in to_save: - if not current_user.role_upload() and to_save["cover_url"] != "": - return "", (403) - result, error = helper.save_cover_from_url(to_save["cover_url"], book.path) - if result is True: - book.has_cover = 1 - modif_date = True - else: - flash(error, category="error") + if to_save["cover_url"]: + if not current_user.role_upload(): + return "", (403) + result, error = helper.save_cover_from_url(to_save["cover_url"], book.path) + if result is True: + book.has_cover = 1 + modif_date = True + else: + flash(error, category="error") # Add default series_index to book modif_date |= edit_book_series_index(to_save["series_index"], book)