diff --git a/cps/admin.py b/cps/admin.py index 0cf087ef..610afa17 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -163,7 +163,7 @@ def queue_metadata_backup(): show_text = {} log.warning("Queuing all books for metadata backup") helper.set_all_metadata_dirty() - show_text['text'] = _('Success! Books queued for Metadata Backup') + show_text['text'] = _('Success! Books queued for Metadata Backup, please check Tasks for result') return json.dumps(show_text) @@ -1940,10 +1940,10 @@ def _delete_user(content): log.info("User {} deleted".format(content.name)) return _("User '%(nick)s' deleted", nick=content.name) else: - log.warning(_("Can't delete Guest User")) + # log.warning(_("Can't delete Guest User")) raise Exception(_("Can't delete Guest User")) else: - log.warning("No admin user remaining, can't delete user") + # log.warning("No admin user remaining, can't delete user") raise Exception(_("No admin user remaining, can't delete user")) @@ -1995,7 +1995,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support): else: content.role &= ~constants.ROLE_ANONYMOUS if to_save.get("password", ""): - content.password = generate_password_hash(helper.valid_password(to_save.get["password"])) + content.password = generate_password_hash(helper.valid_password(to_save.get("password", ""))) new_email = valid_email(to_save.get("email", content.email)) if not new_email: diff --git a/cps/tasks/metadata_backup.py b/cps/tasks/metadata_backup.py index b700b22a..2bb2a06f 100644 --- a/cps/tasks/metadata_backup.py +++ b/cps/tasks/metadata_backup.py @@ -89,7 +89,6 @@ class TaskBackupMetadata(CalibreTask): self.open_metadata(book, custom_columns) else: self.log.error("Book {} not found in database".format(backup.book)) - # self._handleError("Book {} not found in database".format(backup.book)) i += 1 self.progress = (1.0 / count) * i self._handleSuccess() @@ -230,9 +229,8 @@ class TaskBackupMetadata(CalibreTask): try: with open(book_metadata_filepath, 'wb') as f: doc.write(f, xml_declaration=True, encoding='utf-8', pretty_print=True) - except Exception: - # ToDo: Folder not writeable error - pass + except Exception as ex: + raise Exception('Writing Metadata failed with error: {} '.format(ex)) @property def name(self): diff --git a/cps/web.py b/cps/web.py index 2578ed48..528e1db4 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1423,7 +1423,7 @@ def change_profile(kobo_support, local_oauth_check, oauth_status, translations, try: if current_user.role_passwd() or current_user.role_admin(): if to_save.get("password", "") != "": - current_user.password = generate_password_hash(to_save.get("password")) + current_user.password = generate_password_hash(valid_password(to_save.get("password"))) if to_save.get("kindle_mail", current_user.kindle_mail) != current_user.kindle_mail: current_user.kindle_mail = valid_email(to_save.get("kindle_mail")) new_email = valid_email(to_save.get("email", current_user.email)) diff --git a/optional-requirements.txt b/optional-requirements.txt index dabbd08d..85a3d5f0 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -37,7 +37,7 @@ beautifulsoup4>=4.0.1,<4.12.0 cchardet>=2.0.0,<2.2.0 # Comics -natsort>=2.2.0,<8.3.0 +natsort>=2.2.0,<8.4.0 comicapi>=2.2.0,<2.3.0 # Kobo integration diff --git a/requirements.txt b/requirements.txt index 1eaffa38..e6f227be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,9 +7,9 @@ Flask-Principal>=0.3.2,<0.5.1 backports_abc>=0.4 Flask>=1.0.2,<2.3.0 iso-639>=0.4.5,<0.5.0 -PyPDF==3.4.0 +PyPDF==3.6.0 pytz>=2016.10 -requests>=2.11.1,<2.28.0 +requests>=2.11.1,<2.29.0 SQLAlchemy>=1.3.0,<2.0.0 tornado>=4.1,<6.3 Wand>=0.4.4,<0.7.0 @@ -18,4 +18,4 @@ lxml>=3.8.0,<5.0.0 flask-wtf>=0.14.2,<1.2.0 chardet>=3.0.0,<4.1.0 advocate>=1.0.0,<1.1.0 -Flask-Limiter>=2.3.0,<3.3.0 +Flask-Limiter>=2.3.0,<3.4.0 diff --git a/setup.cfg b/setup.cfg index 91acc9f0..9c772414 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,7 +58,7 @@ install_requires = flask-wtf>=0.14.2,<1.2.0 chardet>=3.0.0,<4.1.0 advocate>=1.0.0,<1.1.0 - Flask-Limiter>=2.3.0,<3.2.0 + Flask-Limiter>=2.3.0,<3.3.0 [options.extras_require] diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 06f5a539..2c8c5f9c 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2023-02-15 20:17:44

+

Start Time: 2023-03-03 20:00:16

-

Stop Time: 2023-02-16 02:39:07

+

Stop Time: 2023-03-04 02:33:04

-

Duration: 5h 24 min

+

Duration: 5h 37 min

@@ -102,11 +102,11 @@ - + TestAnonymous 13 - 4 - 9 + 13 + 0 0 0 @@ -134,234 +134,74 @@ - +
TestAnonymous - test_guest_change_visibility_category
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_format
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_hot
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_language
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_publisher
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_rated
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_rating
- -
- FAIL -
- - - - + PASS - +
TestAnonymous - test_guest_change_visibility_series
- -
- FAIL -
- - - - + PASS @@ -384,31 +224,11 @@ AssertionError: False is not true - +
TestAnonymous - test_guest_visibility_sidebar
- -
- FAIL -
- - - - + PASS @@ -864,592 +684,43 @@ AssertionError: False is not true - + TestEbookConvertKepubify - 6 + 3 + 3 0 0 - 6 0 - Detail + Detail - +
TestEbookConvertKepubify - test_convert_deactivate
- -
- ERROR -
- - - - + PASS - - -
TestEbookConvertKepubify - test_convert_deactivate
- - -
- ERROR -
- - - - - - - - - +
TestEbookConvertKepubify - test_convert_only
- -
- ERROR -
- - - - + PASS - - -
TestEbookConvertKepubify - test_convert_only
- - -
- ERROR -
- - - - - - - - - +
TestEbookConvertKepubify - test_convert_wrong_excecutable
- -
- ERROR -
- - - - - - - - - - -
TestEbookConvertKepubify - test_convert_wrong_excecutable
- - -
- ERROR -
- - - - + PASS @@ -2526,27 +1797,9 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 226, in test_edit_title
-    self.edit_book(content={'book_title': u'Very long extra super turbo cool title without any issue of displaying including ö utf-8 characters'})
-  File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1761, in edit_book
-    ele.send_keys(Keys.DELETE)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 230, in send_keys
-    self._execute(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 403, in _execute
-    return self._parent.execute(command, params)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
-    self.error_handler.check_response(response)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
-    raise exception_class(message, screen, stacktrace)
-selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <input id="book_title" class="form-control" name="book_title" type="text"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
-Stacktrace:
-RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
-WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:180:5
-StaleElementReferenceError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:461:5
-element.resolveElement@chrome://remote/content/marionette/element.sys.mjs:674:11
-evaluate.fromJSON@chrome://remote/content/marionette/evaluate.sys.mjs:255:31
-evaluate.fromJSON@chrome://remote/content/marionette/evaluate.sys.mjs:263:29
-receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:74:34
+ 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'
@@ -3093,11 +2346,11 @@ receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild - + TestLdapLogin 13 - 12 - 1 + 13 + 0 0 0 @@ -3215,41 +2468,21 @@ receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild - +
TestLdapLogin - test_ldap_opds_download_book
- -
- FAIL -
- - - - + PASS - + TestSecurity 4 - 3 - 1 + 4 + 0 0 0 @@ -3286,31 +2519,11 @@ AssertionError: False is not true - +
TestSecurity - test_register_limit
- -
- FAIL -
- - - - + PASS @@ -3534,11 +2747,11 @@ AssertionError: False is not true - + TestLogin 17 - 16 - 1 + 17 + 0 0 0 @@ -3620,31 +2833,11 @@ AssertionError: False is not true - +
TestLogin - test_login_rename_user
- -
- FAIL -
- - - - + PASS @@ -3788,12 +2981,12 @@ AssertionError: False is not true - + TestOPDSFeed 23 - 12 - 10 - 1 + 23 + 0 + 0 0 Detail @@ -3829,31 +3022,11 @@ AssertionError: False is not true - +
TestOPDSFeed - test_opds_calibre_companion
- -
- FAIL -
- - - - + PASS @@ -3912,31 +3085,11 @@ AssertionError: 200 != 429 - +
TestOPDSFeed - test_opds_language
- -
- FAIL -
- - - - + PASS @@ -3950,60 +3103,20 @@ AssertionError: 200 != 429 - +
TestOPDSFeed - test_opds_publisher
- -
- FAIL -
- - - - + PASS - +
TestOPDSFeed - test_opds_random
- -
- FAIL -
- - - - + PASS @@ -4017,178 +3130,56 @@ AssertionError: 200 != 429 - +
TestOPDSFeed - test_opds_read_unread
- -
- FAIL -
- - - - + PASS - +
TestOPDSFeed - test_opds_search
- -
- ERROR -
- - - - + PASS - +
TestOPDSFeed - test_opds_series
- -
- FAIL -
- - - - + PASS - +
TestOPDSFeed - test_opds_shelf_access
- -
- FAIL -
- - - - + PASS - +
TestOPDSFeed - test_opds_tags
- -
- FAIL -
- - - - + PASS - +
TestOPDSFeed - test_opds_top_rated
- -
- FAIL -
- - - - + PASS @@ -4202,31 +3193,11 @@ AssertionError: 200 != 429 - +
TestOPDSFeed - test_recently_added
- -
- FAIL -
- - - - + PASS @@ -4382,12 +3353,12 @@ AssertionError: 10 != 11 - + TestRegister 8 - 1 - 4 - 3 + 8 + 0 + 0 0 Detail @@ -4405,236 +3376,65 @@ AssertionError: 10 != 11 - +
TestRegister - test_illegal_email
- -
- FAIL -
- - - - + PASS - +
TestRegister - test_limit_domain
- -
- FAIL -
- - - - + PASS - +
TestRegister - test_register_no_server
- -
- ERROR -
- - - - + PASS - +
TestRegister - test_registering_only_email
- -
- ERROR -
- - - - + PASS - +
TestRegister - test_registering_user
- -
- FAIL -
- - - - + PASS - +
TestRegister - test_registering_user_fail
- -
- FAIL -
- - - - + PASS - +
TestRegister - test_user_change_password
- -
- ERROR -
- - - - + PASS @@ -4682,12 +3482,12 @@ element.find/</<@chrome://remote/content/marionette/element.sys.mjs:275:16 - + TestShelf 16 - 13 - 1 - 1 + 15 + 0 + 0 1 Detail @@ -4795,60 +3595,20 @@ element.find/</<@chrome://remote/content/marionette/element.sys.mjs:275:16 - +
TestShelf - test_shelf_action_non_shelf_edit_role
- -
- FAIL -
- - - - + PASS - +
TestShelf - test_shelf_anonymous
- -
- ERROR -
- - - - + PASS @@ -5182,11 +3942,11 @@ AttributeError: 'bool' object has no attribute 'click' - + TestUserList 18 - 13 - 5 + 18 + 0 0 0 @@ -5196,31 +3956,11 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestUserList - test_edit_user_email
- -
- FAIL -
- - - - + PASS @@ -5279,64 +4019,20 @@ AssertionError: False is not true - +
TestUserList - test_user_list_edit_email
- -
- FAIL -
- - - - + PASS - +
TestUserList - test_user_list_edit_kindle
- -
- FAIL -
- - - - + PASS @@ -5404,68 +4100,20 @@ AssertionError: 'muki1al@b.com' != 'low@de.de' - +
TestUserList - test_user_list_search
- -
- FAIL -
- - - - + PASS - +
TestUserList - test_user_list_sort
- -
- FAIL -
- - - - + PASS @@ -6029,12 +4677,12 @@ AssertionError: '1al@b.com' != '1@2.3' - + TestCalibreHelper 16 - 15 + 16 + 0 0 - 1 0 Detail @@ -6160,31 +4808,11 @@ AssertionError: '1al@b.com' != '1@2.3' - +
TestCalibreHelper - test_random_password
- -
- ERROR -
- - - - + PASS @@ -6209,10 +4837,10 @@ TypeError: generate_random_password() missing 1 required positional argument: &# Total - 434 - 382 - 32 - 13 + 431 + 423 + 0 + 1 7   @@ -6241,7 +4869,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# Platform - Linux 5.19.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 15 12:05:40 UTC 2 x86_64 x86_64 + Linux 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 Basic @@ -6259,13 +4887,13 @@ TypeError: generate_random_password() missing 1 required positional argument: &# APScheduler - 3.10.0 + 3.10.1 Basic Babel - 2.11.0 + 2.12.1 Basic @@ -6295,7 +4923,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# Flask-Limiter - 3.1.0 + 3.2.0 Basic @@ -6397,7 +5025,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestCliGdrivedb @@ -6415,7 +5043,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestCliGdrivedb @@ -6427,7 +5055,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestEbookConvertCalibreGDrive @@ -6445,7 +5073,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestEbookConvertCalibreGDrive @@ -6457,7 +5085,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestEbookConvertGDriveKepubify @@ -6475,7 +5103,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestEbookConvertGDriveKepubify @@ -6499,7 +5127,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestEditAuthorsGdrive @@ -6517,7 +5145,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestEditAuthorsGdrive @@ -6535,7 +5163,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestEditBooksOnGdrive @@ -6553,7 +5181,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestEditBooksOnGdrive @@ -6577,7 +5205,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# google-api-python-client - 2.78.0 + 2.80.0 TestSetupGdrive @@ -6595,7 +5223,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &# PyDrive2 - 1.15.0 + 1.15.1 TestSetupGdrive @@ -6667,7 +5295,7 @@ TypeError: generate_random_password() missing 1 required positional argument: &#