diff --git a/cps/editbooks.py b/cps/editbooks.py index 06c8b12b..e87ea961 100755 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -226,7 +226,7 @@ def edit_book(book_id): except (OperationalError, IntegrityError, StaleDataError, InterfaceError) as e: log.error_or_exception("Database error: {}".format(e)) calibre_db.session.rollback() - flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error") + flash(_("Oops! Database Error: %(error)s.", error=e.orig if hasattr(e, "orig") else e), category="error") return redirect(url_for('web.show_book', book_id=book.id)) except Exception as ex: log.error_or_exception(ex) @@ -302,7 +302,8 @@ def upload(): except (OperationalError, IntegrityError, StaleDataError) as e: calibre_db.session.rollback() log.error_or_exception("Database error: {}".format(e)) - flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error") + flash(_("Oops! Database Error: %(error)s.", error=e.orig if hasattr(e, "orig") else e), + category="error") return Response(json.dumps({"location": url_for("web.index")}), mimetype='application/json') @@ -451,7 +452,7 @@ def edit_list_book(param): calibre_db.session.rollback() log.error_or_exception("Database error: {}".format(e)) ret = Response(json.dumps({'success': False, - 'msg': 'Database error: {}'.format(e.orig)}), + 'msg': 'Database error: {}'.format(e.orig if hasattr(e, "orig") else e)}), mimetype='application/json') return ret @@ -563,7 +564,7 @@ def table_xchange_author_title(): calibre_db.session.commit() except (OperationalError, IntegrityError, StaleDataError) as e: calibre_db.session.rollback() - log.error_or_exception("Database error: %s", e) + log.error_or_exception("Database error: {}".format(e)) return json.dumps({'success': False}) if config.config_use_google_drive: @@ -1199,7 +1200,8 @@ def upload_single_file(file_request, book, book_id): except (OperationalError, IntegrityError, StaleDataError) as e: calibre_db.session.rollback() log.error_or_exception("Database error: {}".format(e)) - flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error") + flash(_("Oops! Database Error: %(error)s.", error=e.orig if hasattr(e, "orig") else e), + category="error") return False # return redirect(url_for('web.show_book', book_id=book.id)) # Queue uploader info diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 1d27d122..62ba5c4e 100755 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -11,7 +11,7 @@
@@ -2537,31 +2134,11 @@ AttributeError: 'bool' object has no attribute 'text' -Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 811, in test_upload_book_lit - self.check_element_on_page((By.ID, 'edit_cancel')).click() -AttributeError: 'bool' object has no attribute 'click'-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 892, in test_watch_metadata + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 902, in test_watch_metadata self.assertTrue(button) AssertionError: False is not true
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_edit_metadata_scholar.py", line 68, in test_load_metadata + self.assertEqual(30, len(results)) +AssertionError: 30 != 0+
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 193, in test_cache_of_deleted_book - self.assertEqual(len(res), 1) -AssertionError: 2 != 1-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 80, in test_cover_cache_on_database_change - self.assertLessEqual(len(res), 1, res) -AssertionError: 2 not less than or equal to 1 : [{'user': 'System', 'task': 'Metadata backup: Backing up Metadata', 'result': 'Finished', 'progress': '100 %', 'duration': ' 0s', 'start': '3/22/23, 1:13\u202fAM'}, {'user': 'System', 'task': 'Cover Thumbnails: Generated 222 cover thumbnails', 'result': 'Finished', 'progress': '100 %', 'duration': ' 5s', 'start': '3/22/23, 1:13\u202fAM'}]-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 123, in test_cover_change_on_upload_new_cover - self.assertLessEqual(len(res), 1) -AssertionError: 2 not less than or equal to 1-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 320, in test_sideloaded_book - self.assertGreaterEqual(diff(BytesIO(list_cover), BytesIO(new_list_cover), delete_diff_file=True), 0.04) -AssertionError: 0.0 not greater than or equal to 0.04+ File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 310, in test_sideloaded_book + self.assertAlmostEqual(diff(BytesIO(list_cover), BytesIO(old_list_cover), delete_diff_file=True), 0.0, +AssertionError: 0.006465888577653282 != 0.0 within 0.0001 delta (0.006465888577653282 difference)