From 6d839d5cc71cbb8f839fb95365f838d8fd01f94c Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 4 Jan 2022 21:12:59 +0100 Subject: [PATCH] Bugfixes from testrun --- cps/editbooks.py | 11 +- cps/static/js/main.js | 5 +- test/Calibre-Web TestSummary_Linux.html | 1035 ++++++++++------------- 3 files changed, 461 insertions(+), 590 deletions(-) mode change 100644 => 100755 cps/editbooks.py mode change 100644 => 100755 cps/static/js/main.js diff --git a/cps/editbooks.py b/cps/editbooks.py old mode 100644 new mode 100755 index b6fdc164..e20cfcfb --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -357,7 +357,16 @@ def delete_book_from_table(book_id, book_format, jsonResponse): else: # book not found log.error('Book with id "%s" could not be deleted: not found', book_id) - return render_delete_book_result(book_format, jsonResponse, warning, book_id) + return render_delete_book_result(book_format, jsonResponse, warning, book_id) + message = _("You are missing permissions to delete books") + if jsonResponse: + return json.dumps({"location": url_for("editbook.edit_book", book_id=book_id), + "type": "danger", + "format": "", + "message": message}) + else: + flash(message, category="error") + return redirect(url_for('editbook.edit_book', book_id=book_id)) def render_edit_book(book_id): diff --git a/cps/static/js/main.js b/cps/static/js/main.js old mode 100644 new mode 100755 index e8da76ef..cf5a4327 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -198,7 +198,7 @@ function confirmDialog(id, dialogid, dataValue, yesFn, noFn) { $confirm.modal('show'); } -$("#delete_confirm").click(function() { +$("#delete_confirm").click(function(event) { //get data-id attribute of the clicked element var deleteId = $(this).data("delete-id"); var bookFormat = $(this).data("delete-format"); @@ -228,8 +228,7 @@ $("#delete_confirm").click(function() { } }); } else { - window.location.href = getPath() + "/delete/" + deleteId; - + postButton(event, getPath() + "/delete/" + deleteId); } } diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index d291d368..511300be 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2021-12-22 20:24:40

+

Start Time: 2022-01-02 17:11:15

-

Stop Time: 2021-12-23 00:00:41

+

Stop Time: 2022-01-02 21:33:59

-

Duration: 2h 57 min

+

Duration: 3h 43 min

@@ -411,21 +411,50 @@ - + TestEbookConvertCalibre + 15 14 - 14 - 0 + 1 0 0 - Detail + Detail - + + +
TestEbookConvertCalibre - test_calibre_log
+ + +
+ FAIL +
+ + + + + + + + +
TestEbookConvertCalibre - test_convert_deactivate
@@ -434,7 +463,7 @@ - +
TestEbookConvertCalibre - test_convert_email
@@ -443,7 +472,7 @@ - +
TestEbookConvertCalibre - test_convert_failed_and_email
@@ -452,7 +481,7 @@ - +
TestEbookConvertCalibre - test_convert_only
@@ -461,7 +490,7 @@ - +
TestEbookConvertCalibre - test_convert_options
@@ -470,7 +499,7 @@ - +
TestEbookConvertCalibre - test_convert_parameter
@@ -479,7 +508,7 @@ - +
TestEbookConvertCalibre - test_convert_wrong_excecutable
@@ -488,7 +517,7 @@ - +
TestEbookConvertCalibre - test_convert_xss
@@ -497,7 +526,7 @@ - +
TestEbookConvertCalibre - test_email_failed
@@ -506,7 +535,7 @@ - +
TestEbookConvertCalibre - test_email_only
@@ -515,7 +544,7 @@ - +
TestEbookConvertCalibre - test_kindle_send_not_configured
@@ -524,7 +553,7 @@ - +
TestEbookConvertCalibre - test_ssl_smtp_setup_error
@@ -533,7 +562,7 @@ - +
TestEbookConvertCalibre - test_starttls_smtp_setup_error
@@ -542,7 +571,7 @@ - +
TestEbookConvertCalibre - test_user_convert_xss
@@ -782,11 +811,31 @@ - +
TestEditAdditionalBooks - test_title_sort
- PASS + +
+ FAIL +
+ + + + @@ -844,31 +893,11 @@ - +
TestEditAdditionalBooks - test_writeonly_path
- -
- FAIL -
- - - - + PASS @@ -901,11 +930,11 @@ AssertionError: False is not true - + TestEditBooks 35 - 32 - 2 + 34 + 0 0 1 @@ -924,31 +953,11 @@ AssertionError: False is not true - +
TestEditBooks - test_edit_author
- -
- FAIL -
- - - - + PASS @@ -1097,31 +1106,11 @@ AssertionError: False is not true - +
TestEditBooks - test_edit_title
- -
- FAIL -
- - - - + PASS @@ -1466,20 +1455,64 @@ AssertionError: False is not true - TestEditBooksOnGdrive - 20 - 18 - 2 + TestEditMetadata + 1 + 0 + 1 0 0 - Detail + Detail - + + +
TestEditMetadata - test_upload_book_lit
+ + +
+ FAIL +
+ + + + + + + + + + + TestEditBooksOnGdrive + 20 + 20 + 0 + 0 + 0 + + Detail + + + + + +
TestEditBooksOnGdrive - test_download_book
@@ -1488,36 +1521,16 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_author
- -
- FAIL -
- - - - + PASS - +
TestEditBooksOnGdrive - test_edit_category
@@ -1526,7 +1539,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_comments
@@ -1535,7 +1548,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_bool
@@ -1544,7 +1557,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_categories
@@ -1553,7 +1566,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_float
@@ -1562,7 +1575,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_int
@@ -1571,7 +1584,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_rating
@@ -1580,7 +1593,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_single_select
@@ -1589,7 +1602,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_custom_text
@@ -1598,7 +1611,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_language
@@ -1607,7 +1620,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_publisher
@@ -1616,7 +1629,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_rating
@@ -1625,7 +1638,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_series
@@ -1634,36 +1647,16 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_title
- -
- FAIL -
- - - - + PASS - +
TestEditBooksOnGdrive - test_upload_book_epub
@@ -1672,7 +1665,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_upload_book_lit
@@ -1681,7 +1674,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_upload_cover_hdd
@@ -1690,7 +1683,7 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_watch_metadata
@@ -1708,13 +1701,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestSTARTTLS - test_STARTTLS
@@ -1723,7 +1716,7 @@ AssertionError: False is not true - +
TestSTARTTLS - test_STARTTLS_SSL_setup_error
@@ -1732,7 +1725,7 @@ AssertionError: False is not true - +
TestSTARTTLS - test_STARTTLS_resend_password
@@ -1750,13 +1743,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestSSL - test_SSL_None_setup_error
@@ -1765,7 +1758,7 @@ AssertionError: False is not true - +
TestSSL - test_SSL_STARTTLS_setup_error
@@ -1774,7 +1767,7 @@ AssertionError: False is not true - +
TestSSL - test_SSL_logging_email
@@ -1783,7 +1776,7 @@ AssertionError: False is not true - +
TestSSL - test_SSL_non_admin_user
@@ -1792,7 +1785,7 @@ AssertionError: False is not true - +
TestSSL - test_SSL_only
@@ -1801,7 +1794,7 @@ AssertionError: False is not true - +
TestSSL - test_email_limit
@@ -1810,7 +1803,7 @@ AssertionError: False is not true - +
TestSSL - test_filepicker_two_file
@@ -1828,13 +1821,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestBookDatabase - test_invalid_book_path
@@ -1852,13 +1845,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestErrorReadColumn - test_invalid_custom_column
@@ -1876,13 +1869,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestFilePicker - test_filepicker_limited_file
@@ -1900,13 +1893,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestSetupGdrive - test_config_gdrive
@@ -1924,13 +1917,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestGoodreads - test_author_page
@@ -1939,7 +1932,7 @@ AssertionError: False is not true - +
TestGoodreads - test_author_page_invalid
@@ -1948,7 +1941,7 @@ AssertionError: False is not true - +
TestGoodreads - test_goodreads_about
@@ -1966,13 +1959,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestKoboSync - test_book_download
@@ -1981,7 +1974,7 @@ AssertionError: False is not true - +
TestKoboSync - test_kobo_about
@@ -1990,7 +1983,7 @@ AssertionError: False is not true - +
TestKoboSync - test_kobo_sync_selected_shelfs
@@ -1999,7 +1992,7 @@ AssertionError: False is not true - +
TestKoboSync - test_kobo_upload_book
@@ -2008,7 +2001,7 @@ AssertionError: False is not true - +
TestKoboSync - test_shelves_add_remove_books
@@ -2017,7 +2010,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_changed_book
@@ -2026,7 +2019,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_invalid
@@ -2035,7 +2028,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_reading_state
@@ -2044,7 +2037,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_shelf
@@ -2053,7 +2046,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_unchanged
@@ -2062,7 +2055,7 @@ AssertionError: False is not true - +
TestKoboSync - test_sync_upload
@@ -2080,13 +2073,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestKoboSyncBig - test_kobo_sync_multi_user
@@ -2095,7 +2088,7 @@ AssertionError: False is not true - +
TestKoboSyncBig - test_kobo_sync_selected_shelfs
@@ -2104,7 +2097,7 @@ AssertionError: False is not true - +
TestKoboSyncBig - test_sync_changed_book
@@ -2113,7 +2106,7 @@ AssertionError: False is not true - +
TestKoboSyncBig - test_sync_reading_state
@@ -2122,7 +2115,7 @@ AssertionError: False is not true - +
TestKoboSyncBig - test_sync_shelf
@@ -2140,13 +2133,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestLdapLogin - test_LDAP_SSL
@@ -2155,7 +2148,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_SSL_CERTIFICATE
@@ -2164,7 +2157,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_STARTTLS
@@ -2173,7 +2166,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_fallback_Login
@@ -2182,7 +2175,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_import
@@ -2191,7 +2184,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_import_memberfield
@@ -2200,7 +2193,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_LDAP_login
@@ -2209,7 +2202,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_invalid_LDAP
@@ -2218,7 +2211,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_ldap_about
@@ -2227,7 +2220,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_ldap_authentication
@@ -2236,7 +2229,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_ldap_kobo_sync
@@ -2245,7 +2238,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_ldap_opds_anonymous
@@ -2254,7 +2247,7 @@ AssertionError: False is not true - +
TestLdapLogin - test_ldap_opds_download_book
@@ -2272,13 +2265,13 @@ AssertionError: False is not true 0 0 - Detail + Detail - +
TestCalibreWebListOrders - test_author_sort
@@ -2287,7 +2280,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_download_sort
@@ -2296,7 +2289,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_format_sort
@@ -2305,7 +2298,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_lang_sort
@@ -2314,7 +2307,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_publisher_sort
@@ -2323,7 +2316,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_ratings_sort
@@ -2332,7 +2325,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_series_sort
@@ -2341,7 +2334,7 @@ AssertionError: False is not true - +
TestCalibreWebListOrders - test_tags_sort
@@ -2359,13 +2352,13 @@ AssertionError: False is not true 0 1 - Detail + Detail - +
TestLogging - test_access_log_recover
@@ -2374,7 +2367,7 @@ AssertionError: False is not true - +
TestLogging - test_debug_log
@@ -2383,7 +2376,7 @@ AssertionError: False is not true - +
TestLogging - test_debuginfo_download
@@ -2392,7 +2385,7 @@ AssertionError: False is not true - +
TestLogging - test_failed_login
@@ -2401,19 +2394,19 @@ AssertionError: False is not true - +
TestLogging - test_failed_register
- SKIP + SKIP
-