From 77637d81dd826979d69a6acb9bc05fa3cb55631d Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 22 Jan 2023 07:42:44 +0100 Subject: [PATCH] Fix fro #2670 (user has no attribute eReader_mail) --- cps/web.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cps/web.py b/cps/web.py index 036681ea..bd0c8bac 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1198,11 +1198,11 @@ def download_link(book_id, book_format, anyname): def send_to_ereader(book_id, book_format, convert): if not config.get_mail_server_configured(): flash(_("Please configure the SMTP mail settings first."), category="error") - elif current_user.eReader_mail: - result = send_mail(book_id, book_format, convert, current_user.eReader_mail, config.config_calibre_dir, + elif current_user.kindle_mail: + result = send_mail(book_id, book_format, convert, current_user.kindle_mail, config.config_calibre_dir, current_user.name) if result is None: - flash(_("Success! Book queued for sending to %(eReadermail)s", eReadermail=current_user.eReader_mail), + flash(_("Success! Book queued for sending to %(eReadermail)s", eReadermail=current_user.kindle_mail), category="success") ub.update_download(book_id, int(current_user.id)) else: @@ -1366,8 +1366,8 @@ def change_profile(kobo_support, local_oauth_check, oauth_status, translations, if to_save.get("password"): current_user.password = generate_password_hash(to_save.get("password")) try: - if to_save.get("eReader_mail", current_user.eReader_mail) != current_user.eReader_mail: - current_user.eReader_mail = valid_email(to_save.get("eReader_mail")) + if to_save.get("eReader_mail", current_user.kindle_mail) != current_user.kindle_mail: + current_user.kindle_mail = valid_email(to_save.get("eReader_mail")) new_email = valid_email(to_save.get("email", current_user.email)) if not new_email: raise Exception(_("Email can't be empty and has to be a valid Email"))