diff --git a/cps/admin.py b/cps/admin.py index 9d820008..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) @@ -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/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..b003eb8f 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-02-28 19:53:13

-

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

+

Stop Time: 2023-03-01 02:13:56

-

Duration: 5h 24 min

+

Duration: 5h 28 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,45 +224,25 @@ AssertionError: False is not true - +
TestAnonymous - test_guest_visibility_sidebar
- -
- FAIL -
- - - - + PASS - TestCli - 12 - 12 + TestBackupMetadata + 11 + 11 0 0 0 - Detail + Detail @@ -430,7 +250,7 @@ AssertionError: False is not true -
TestCli - test_already_started
+
TestBackupMetadata - test_backup_all
PASS @@ -439,7 +259,7 @@ AssertionError: False is not true -
TestCli - test_bind_to_single_interface
+
TestBackupMetadata - test_backup_change_book_author
PASS @@ -448,7 +268,7 @@ AssertionError: False is not true -
TestCli - test_change_password
+
TestBackupMetadata - test_backup_change_book_custom_bool
PASS @@ -457,7 +277,7 @@ AssertionError: False is not true -
TestCli - test_cli_SSL_files
+
TestBackupMetadata - test_backup_change_book_publisher
PASS @@ -466,7 +286,7 @@ AssertionError: False is not true -
TestCli - test_cli_different_folder
+
TestBackupMetadata - test_backup_change_book_publishing_date
PASS @@ -475,7 +295,7 @@ AssertionError: False is not true -
TestCli - test_cli_different_settings_database
+
TestBackupMetadata - test_backup_change_book_read_status
PASS @@ -484,7 +304,7 @@ AssertionError: False is not true -
TestCli - test_dryrun_update
+
TestBackupMetadata - test_backup_change_book_series
PASS @@ -493,7 +313,7 @@ AssertionError: False is not true -
TestCli - test_enable_reconnect
+
TestBackupMetadata - test_backup_change_book_seriesindex
PASS @@ -502,7 +322,7 @@ AssertionError: False is not true -
TestCli - test_environ_port_setting
+
TestBackupMetadata - test_backup_change_book_tags
PASS @@ -511,7 +331,7 @@ AssertionError: False is not true -
TestCli - test_no_database
+
TestBackupMetadata - test_backup_change_book_title
PASS @@ -520,16 +340,7 @@ AssertionError: False is not true -
TestCli - test_settingsdb_not_writeable
- - PASS - - - - - - -
TestCli - test_writeonly_static_files
+
TestBackupMetadata - test_grdive
PASS @@ -538,14 +349,14 @@ AssertionError: False is not true - TestCliGdrivedb - 4 - 4 + TestCli + 12 + 12 0 0 0 - Detail + Detail @@ -553,7 +364,7 @@ AssertionError: False is not true -
TestCliGdrivedb - test_cli_gdrive_folder
+
TestCli - test_already_started
PASS @@ -562,7 +373,7 @@ AssertionError: False is not true -
TestCliGdrivedb - test_cli_gdrive_location
+
TestCli - test_bind_to_single_interface
PASS @@ -571,7 +382,7 @@ AssertionError: False is not true -
TestCliGdrivedb - test_gdrive_db_nonwrite
+
TestCli - test_change_password
PASS @@ -580,214 +391,187 @@ AssertionError: False is not true -
TestCliGdrivedb - test_no_database
- - PASS - - - - - - - TestCoverEditBooks - 2 - 2 - 0 - 0 - 0 - - Detail - - - - - - - -
TestCoverEditBooks - test_invalid_jpg_hdd
+
TestCli - test_cli_SSL_files
PASS - + -
TestCoverEditBooks - test_upload_jpg
+
TestCli - test_cli_different_folder
PASS - - - - TestDeleteDatabase - 1 - 1 - 0 - 0 - 0 - - Detail - - - - - + -
TestDeleteDatabase - test_delete_books_in_database
+
TestCli - test_cli_different_settings_database
PASS - - - - TestEbookConvertCalibre - 15 - 15 - 0 - 0 - 0 - - Detail - - - - - + -
TestEbookConvertCalibre - test_calibre_log
+
TestCli - test_dryrun_update
PASS - + -
TestEbookConvertCalibre - test_convert_deactivate
+
TestCli - test_enable_reconnect
PASS - + -
TestEbookConvertCalibre - test_convert_email
+
TestCli - test_environ_port_setting
PASS - + -
TestEbookConvertCalibre - test_convert_failed_and_email
+
TestCli - test_no_database
PASS - + -
TestEbookConvertCalibre - test_convert_only
+
TestCli - test_settingsdb_not_writeable
PASS - + -
TestEbookConvertCalibre - test_convert_options
+
TestCli - test_writeonly_static_files
PASS - - - -
TestEbookConvertCalibre - test_convert_parameter
- - PASS - - + + + + TestCliGdrivedb + 4 + 4 + 0 + 0 + 0 + + Detail + + + - + -
TestEbookConvertCalibre - test_convert_wrong_excecutable
+
TestCliGdrivedb - test_cli_gdrive_folder
PASS - + -
TestEbookConvertCalibre - test_convert_xss
+
TestCliGdrivedb - test_cli_gdrive_location
PASS - + -
TestEbookConvertCalibre - test_email_failed
+
TestCliGdrivedb - test_gdrive_db_nonwrite
PASS - + -
TestEbookConvertCalibre - test_email_only
+
TestCliGdrivedb - test_no_database
PASS - - - -
TestEbookConvertCalibre - test_kindle_send_not_configured
- - PASS - - + + + + TestCoverEditBooks + 2 + 2 + 0 + 0 + 0 + + Detail + + + - + -
TestEbookConvertCalibre - test_ssl_smtp_setup_error
+
TestCoverEditBooks - test_invalid_jpg_hdd
PASS - + -
TestEbookConvertCalibre - test_starttls_smtp_setup_error
+
TestCoverEditBooks - test_upload_jpg
PASS + + + + TestDeleteDatabase + 1 + 1 + 0 + 0 + 0 + + Detail + + + + - + -
TestEbookConvertCalibre - test_user_convert_xss
+
TestDeleteDatabase - test_delete_books_in_database
PASS @@ -796,14 +580,14 @@ AssertionError: False is not true - TestEbookConvertCalibreGDrive - 6 - 6 + TestEbookConvertCalibre + 15 + 15 0 0 0 - Detail + Detail @@ -811,7 +595,7 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_convert_email
+
TestEbookConvertCalibre - test_calibre_log
PASS @@ -820,7 +604,7 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
+
TestEbookConvertCalibre - test_convert_deactivate
PASS @@ -829,7 +613,7 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_convert_only
+
TestEbookConvertCalibre - test_convert_email
PASS @@ -838,7 +622,7 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_convert_parameter
+
TestEbookConvertCalibre - test_convert_failed_and_email
PASS @@ -847,7 +631,7 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_email_failed
+
TestEbookConvertCalibre - test_convert_only
PASS @@ -856,7 +640,88 @@ AssertionError: False is not true -
TestEbookConvertCalibreGDrive - test_email_only
+
TestEbookConvertCalibre - test_convert_options
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_convert_parameter
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_convert_wrong_excecutable
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_convert_xss
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_email_failed
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_email_only
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_kindle_send_not_configured
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_ssl_smtp_setup_error
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_starttls_smtp_setup_error
+ + PASS + + + + + + +
TestEbookConvertCalibre - test_user_convert_xss
PASS @@ -865,14 +730,14 @@ AssertionError: False is not true - TestEbookConvertKepubify - 6 + TestEbookConvertCalibreGDrive + 13 0 0 - 6 + 13 0 - Detail + Detail @@ -880,7 +745,7 @@ AssertionError: False is not true -
TestEbookConvertKepubify - test_convert_deactivate
+
TestEbookConvertCalibreGDrive - test_convert_email
@@ -926,21 +791,15 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f06543b7070>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3dc45bd330>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify.py", line 60, in test_convert_deactivate - self.fill_basic_config({'config_kepubifypath': ""}) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 398, in fill_basic_config - cls._fill_basic_config(elements) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 302, in _fill_basic_config - WebDriverWait(cls.driver, 5).until(EC.presence_of_element_located((By.ID, "config_port"))) - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/support/wait.py", line 86, in until - value = method(self._driver) - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py", line 69, in _predicate - return driver.find_element(*locator) + File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py", line 189, in test_convert_email + self.setup_server(True, {'mail_password_e': '10234', 'mail_use_ssl': 'None'}) + File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 733, in setup_server + select = Select(cls.driver.find_element(By.ID, key)) File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 830, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 438, in execute @@ -965,7 +824,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=53967): Max retries exceeded with url: /session/a6cf14b2-710f-43b1-8b46-f8470a56e22a/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f06543b7070>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=36609): Max retries exceeded with url: /session/b563ab83-0fbb-48e3-a23e-a1e051a2ab77/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3dc45bd330>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -977,7 +836,7 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p -
TestEbookConvertKepubify - test_convert_deactivate
+
TestEbookConvertCalibreGDrive - test_convert_email
@@ -1023,12 +882,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f06543b7c10>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3dc45be9b0>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify.py", line 54, in tearDown + File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py", line 135, in tearDown if not self.check_user_logged_in('admin'): File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 117, in check_user_logged_in user_element = cls.check_element_on_page((By.ID, "top_user")) @@ -1062,7 +921,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=53967): Max retries exceeded with url: /session/a6cf14b2-710f-43b1-8b46-f8470a56e22a/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f06543b7c10>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=36609): Max retries exceeded with url: /session/b563ab83-0fbb-48e3-a23e-a1e051a2ab77/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3dc45be9b0>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -1074,7 +933,7 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p -
TestEbookConvertKepubify - test_convert_only
+
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
@@ -1120,14 +979,14 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f06543b6e90>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3dc45d7c40>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify.py", line 110, in test_convert_only - vals = self.get_convert_book(7) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2029, in get_convert_book + File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py", line 240, in test_convert_failed_and_email + vals = self.get_convert_book(1) + File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2041, in get_convert_book cls.driver.get(root_url + "/admin/book/"+str(id)) File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 449, in get self.execute(Command.GET, {"url": url}) @@ -1153,7 +1012,674 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=53967): Max retries exceeded with url: /session/a6cf14b2-710f-43b1-8b46-f8470a56e22a/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f06543b6e90>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=36609): Max retries exceeded with url: /session/b563ab83-0fbb-48e3-a23e-a1e051a2ab77/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3dc45d7c40>: Failed to establish a new connection: [Errno 111] Connection refused')) +
+
+ + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_only
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_only
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_parameter
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_parameter
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_email_failed
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_email_failed
+ + +
+ ERROR +
+ + @@ -1163,19 +1689,19 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p - + -
TestEbookConvertKepubify - test_convert_only
+
TestEbookConvertCalibreGDrive - test_email_only
- ERROR + ERROR
-