From 4b93ac034f15d19aa4d29fb4a6b0b7468479ee4e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 9 Jul 2023 10:23:10 +0200 Subject: [PATCH 1/2] Do not show password in smtp settings --- cps/admin.py | 6 ++++-- cps/templates/config_edit.html | 2 +- cps/templates/email_edit.html | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index a1b65640..2e235c2c 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -1296,7 +1296,8 @@ def update_mailsettings(): else: _config_int(to_save, "mail_port") _config_int(to_save, "mail_use_ssl") - _config_string(to_save, "mail_password_e") + if "mail_password_e" in to_save: + _config_string(to_save, "mail_password_e") _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_from', "").strip() @@ -1780,7 +1781,8 @@ def _configuration_update_helper(): # Goodreads configuration _config_checkbox(to_save, "config_use_goodreads") _config_string(to_save, "config_goodreads_api_key") - _config_string(to_save, "config_goodreads_api_secret_e") + if "config_goodreads_api_secret_e" in to_save: + _config_string(to_save, "config_goodreads_api_secret_e") if services.goodreads_support: services.goodreads_support.connect(config.config_goodreads_api_key, config.config_goodreads_api_secret_e, diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index b11ca1b5..e259ac2f 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -160,7 +160,7 @@
- +
{% endif %} diff --git a/cps/templates/email_edit.html b/cps/templates/email_edit.html index ffd0dea4..eaaecb18 100644 --- a/cps/templates/email_edit.html +++ b/cps/templates/email_edit.html @@ -49,7 +49,7 @@
- +
From caf69669cb26660d196fdda9c45ae12472f1f710 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 31 Jul 2023 19:01:15 +0200 Subject: [PATCH 2/2] Removed encode utf-8 in dodownload --- cps/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/helper.py b/cps/helper.py index be0323a2..92bcb2ad 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -1042,7 +1042,7 @@ def get_download_link(book_id, book_format, client): headers = Headers() headers["Content-Type"] = mimetypes.types_map.get('.' + book_format, "application/octet-stream") headers["Content-Disposition"] = "attachment; filename=%s.%s; filename*=UTF-8''%s.%s" % ( - quote(file_name.encode('utf-8')), book_format, quote(file_name.encode('utf-8')), book_format) + quote(file_name), book_format, quote(file_name), book_format) return do_download_file(book, book_format, client, data1, headers) else: abort(404)