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 @@
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 231, in test_edit_title
-    self.assertEqual(ele.text, u'Very long extra super turbo cool title without any issue of displaying including รถ utf-8 characters')
-AttributeError: 'bool' object has no attribute 'text'
+ File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 189, in test_edit_title + self.assertEqual('The camicdemo', books[1][8]['title']) +IndexError: list index out of range
@@ -2537,31 +2134,11 @@ AttributeError: 'bool' object has no attribute 'text' - +
TestEditBooksOnGdrive - test_upload_book_lit
- -
- ERROR -
- - - - + PASS @@ -2583,7 +2160,7 @@ 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
@@ -2596,11 +2173,11 @@ AssertionError: False is not true - + TestLoadMetadataScholar 1 - 1 0 + 1 0 0 @@ -2610,11 +2187,31 @@ AssertionError: False is not true - +
TestLoadMetadataScholar - test_load_metadata
- PASS + +
+ FAIL +
+ + + + @@ -4453,8 +4050,8 @@ AssertionError: False is not true TestThumbnails 8 - 3 - 4 + 6 + 1 0 1 @@ -4473,89 +4070,29 @@ AssertionError: False is not true - +
TestThumbnails - test_cache_of_deleted_book
- -
- FAIL -
- - - - + PASS - +
TestThumbnails - test_cover_cache_on_database_change
- -
- FAIL -
- - - - + PASS - +
TestThumbnails - test_cover_change_on_upload_new_cover
- -
- FAIL -
- - - - + PASS @@ -4604,9 +4141,9 @@ 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)
@@ -5686,9 +5223,9 @@ AssertionError: 0.0 not greater than or equal to 0.04 Total 454 - 418 + 439 6 - 23 + 2 7   @@ -5874,31 +5411,31 @@ AssertionError: 0.0 not greater than or equal to 0.04 google-api-python-client 2.82.0 - TestBackupMetadata + TestBackupMetadataGdrive httplib2 - 0.21.0 - TestBackupMetadata + 0.22.0 + TestBackupMetadataGdrive oauth2client 4.1.3 - TestBackupMetadata + TestBackupMetadataGdrive PyDrive2 1.15.1 - TestBackupMetadata + TestBackupMetadataGdrive PyYAML 6.0 - TestBackupMetadata + TestBackupMetadataGdrive @@ -5909,7 +5446,7 @@ AssertionError: 0.0 not greater than or equal to 0.04 httplib2 - 0.21.0 + 0.22.0 TestCliGdrivedb @@ -5939,7 +5476,7 @@ AssertionError: 0.0 not greater than or equal to 0.04 httplib2 - 0.21.0 + 0.22.0 TestEbookConvertCalibreGDrive @@ -5969,7 +5506,7 @@ AssertionError: 0.0 not greater than or equal to 0.04 httplib2 - 0.21.0 + 0.22.0 TestEbookConvertGDriveKepubify @@ -6011,7 +5548,7 @@ AssertionError: 0.0 not greater than or equal to 0.04 httplib2 - 0.21.0 + 0.22.0 TestEditAuthorsGdrive @@ -6047,7 +5584,7 @@ AssertionError: 0.0 not greater than or equal to 0.04 httplib2 - 0.21.0 + 0.22.0 TestEditBooksOnGdrive @@ -6173,7 +5710,7 @@ AssertionError: 0.0 not greater than or equal to 0.04