diff --git a/cps/admin.py b/cps/admin.py index ae9da540..f222be02 100755 --- a/cps/admin.py +++ b/cps/admin.py @@ -1269,8 +1269,8 @@ def update_mailsettings(): _config_string(to_save, "mail_password") _config_int(to_save, "mail_size", lambda y: int(y)*1024*1024) config.mail_server = to_save.get('mail_server', "").strip() - config.mail_from = to_save.get('mail_login', "").strip() - config.email = to_save.get('mail_login', "").strip() + config.mail_from = to_save.get('mail_from', "").strip() + config.mail_login = to_save.get('mail_login', "").strip() try: config.save() except (OperationalError, InvalidRequestError) as e: @@ -1671,9 +1671,10 @@ def _db_configuration_update_helper(): if db_change or not db_valid or not config.db_configured \ or config.config_calibre_dir != to_save["config_calibre_dir"]: - if not calibre_db.setup_db(to_save['config_calibre_dir'], ub.app_DB_path): - return _db_configuration_result(_('DB Location is not Valid, Please Enter Correct Path'), - gdrive_error) + if not os.path.exists(metadata_db) or not to_save['config_calibre_dir']: + return _db_configuration_result(_('DB Location is not Valid, Please Enter Correct Path'), gdrive_error) + else: + calibre_db.setup_db(to_save['config_calibre_dir'], ub.app_DB_path) config.store_calibre_uuid(calibre_db, db.Library_Id) # if db changed -> delete shelfs, delete download books, delete read books, kobo sync... if db_change: diff --git a/cps/db.py b/cps/db.py index c4f7ed38..0b98f683 100644 --- a/cps/db.py +++ b/cps/db.py @@ -567,12 +567,12 @@ class CalibreDB: if not config_calibre_dir: cls.config.invalidate() - return False + return None dbpath = os.path.join(config_calibre_dir, "metadata.db") if not os.path.exists(dbpath): cls.config.invalidate() - return False + return None try: cls.engine = create_engine('sqlite://', @@ -588,7 +588,7 @@ class CalibreDB: # conn.text_factory = lambda b: b.decode(errors = 'ignore') possible fix for #1302 except Exception as ex: cls.config.invalidate(ex) - return False + return None cls.config.db_configured = True @@ -598,7 +598,7 @@ class CalibreDB: cls.setup_db_cc_classes(cc) except OperationalError as e: log.error_or_exception(e) - return False + return None cls.session_factory = scoped_session(sessionmaker(autocommit=False, autoflush=True, @@ -607,7 +607,6 @@ class CalibreDB: inst.init_session() cls._init = True - return True def get_book(self, book_id): return self.session.query(Books).filter(Books.id == book_id).first() diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 04d47d6b..cfb0b2f0 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -677,8 +677,8 @@ $(function() { if ( data.change ) { if ( data.valid ) { confirmDialog( - "db_submit", - "GeneralChangeModal", + "db_submit", + "GeneralChangeModal", 0, changeDbSettings ); diff --git a/setup.cfg b/setup.cfg index aff22e9e..92e64f6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,7 +42,7 @@ install_requires = werkzeug<2.1.0 Babel>=1.3,<3.0 Flask-Babel>=0.11.1,<2.1.0 - Flask-Login>=0.3.2,<0.6.1 + Flask-Login>=0.3.2,<0.6.2 Flask-Principal>=0.3.2,<0.5.1 backports_abc>=0.4 Flask>=1.0.2,<2.1.0 @@ -97,5 +97,5 @@ comics = natsort>=2.2.0,<8.2.0 comicapi>=2.2.0,<2.3.0 kobo = - jsonschema>=3.2.0,<4.5.0 + jsonschema>=3.2.0,<4.6.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 79fbdc61..8953c08c 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2022-05-07 17:19:13

+

Start Time: 2022-06-05 22:14:00

-

Stop Time: 2022-05-07 23:07:20

+

Stop Time: 2022-06-06 04:06:43

-

Duration: 4h 55 min

+

Duration: 4h 57 min

@@ -465,12 +465,12 @@ - + TestEbookConvertCalibre 15 - 15 - 0 - 0 + 11 + 3 + 1 0 Detail @@ -497,20 +497,64 @@ - +
TestEbookConvertCalibre - test_convert_email
- PASS + +
+ FAIL +
+ + + + - +
TestEbookConvertCalibre - test_convert_failed_and_email
- PASS + +
+ ERROR +
+ + + + @@ -524,11 +568,33 @@ - +
TestEbookConvertCalibre - test_convert_options
- PASS + +
+ FAIL +
+ + + + @@ -569,11 +635,33 @@ - +
TestEbookConvertCalibre - test_email_only
- PASS + +
+ FAIL +
+ + + + @@ -615,15 +703,15 @@ - + TestEbookConvertCalibreGDrive - 7 + 6 3 - 4 - 0 + 2 + 1 0 - Detail + Detail @@ -646,46 +734,8 @@
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py", line 200, in test_convert_email
-    self.assertTrue("Convert" in ret[-2]['task'])
-AssertionError: False is not true
-
-
- - - - - - - - - -
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
- - PASS - - - - - - -
TestEbookConvertCalibreGDrive - test_convert_only
- - -
- FAIL -
- - - - - - - - - - -
TestEbookConvertCalibreGDrive - test_thumbnail_cache
- - -
- FAIL -
- - @@ -775,12 +838,12 @@ AssertionError: False is not true - + TestEbookConvertKepubify 3 + 3 + 0 0 - 2 - 1 0 Detail @@ -789,102 +852,40 @@ AssertionError: False is not true - +
TestEbookConvertKepubify - test_convert_deactivate
- -
- FAIL -
- - - - + PASS - +
TestEbookConvertKepubify - test_convert_only
- -
- ERROR -
- - - - + PASS - +
TestEbookConvertKepubify - test_convert_wrong_excecutable
- -
- FAIL -
- - - - + PASS - + TestEbookConvertGDriveKepubify 3 + 3 + 0 0 - 2 - 1 0 Detail @@ -893,91 +894,29 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestEbookConvertGDriveKepubify - test_convert_deactivate
- -
- FAIL -
- - - - + PASS - +
TestEbookConvertGDriveKepubify - test_convert_only
- -
- ERROR -
- - - - + PASS - +
TestEbookConvertGDriveKepubify - test_convert_wrong_excecutable
- -
- FAIL -
- - - - + PASS @@ -1846,12 +1785,12 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - + TestEditBooksOnGdrive 18 - 18 - 0 + 17 0 + 1 0 Detail @@ -1995,11 +1934,31 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestEditBooksOnGdrive - test_edit_title
- PASS + +
+ ERROR +
+ + + + @@ -2047,11 +2006,11 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - + TestSTARTTLS 3 - 3 - 0 + 1 + 2 0 0 @@ -2061,11 +2020,33 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestSTARTTLS - test_STARTTLS
- PASS + +
+ FAIL +
+ + + + @@ -2079,31 +2060,148 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestSTARTTLS - test_STARTTLS_resend_password
- PASS + +
+ FAIL +
+ + + + - - TestSSL - 7 - 7 + + _ErrorHolder + 2 0 0 + 2 0 - Detail + Detail - + + +
tearDownClass (test_email_STARTTLS)
+ + +
+ ERROR +
+ + + + + + + + + + +
tearDownClass (test_email_ssl)
+ + +
+ ERROR +
+ + + + + + + + + + + TestSSL + 7 + 2 + 2 + 3 + 0 + + Detail + + + + + +
TestSSL - test_SSL_None_setup_error
@@ -2112,7 +2210,7 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestSSL - test_SSL_STARTTLS_setup_error
@@ -2121,47 +2219,171 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestSSL - test_SSL_logging_email
- PASS + +
+ FAIL +
+ + + + - +
TestSSL - test_SSL_non_admin_user
- PASS + +
+ FAIL +
+ + + + - +
TestSSL - test_SSL_only
- PASS + +
+ ERROR +
+ + + + - +
TestSSL - test_email_limit
- PASS + +
+ ERROR +
+ + + + - +
TestSSL - test_filepicker_two_file
- PASS + +
+ ERROR +
+ + + + @@ -2175,13 +2397,13 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= 0 0 - Detail + Detail - +
TestBookDatabase - test_invalid_book_path
@@ -2199,13 +2421,13 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= 0 0 - Detail + Detail - +
TestErrorReadColumn - test_invalid_custom_column
@@ -2214,7 +2436,7 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestErrorReadColumn - test_invalid_custom_read_column
@@ -2232,13 +2454,13 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= 0 1 - Detail + Detail - +
TestFilePicker - test_filepicker_limited_file
@@ -2247,19 +2469,19 @@ AssertionError: <selenium.webdriver.remote.webelement.WebElement (session= - +
TestFilePicker - test_filepicker_new_file
- SKIP + SKIP
-