1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 12:30:00 +00:00

Bugfix change emails

This commit is contained in:
Ozzie Isaacs 2022-08-28 15:59:25 +02:00
parent 89d226e36b
commit bf0375d51d
2 changed files with 4 additions and 4 deletions

View File

@ -1960,11 +1960,11 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):
if to_save.get("locale"):
content.locale = to_save["locale"]
try:
new_email = check_email(to_save.get("email", content.email))
new_email = valid_email(to_save.get("email", content.email))
if not new_email:
raise Exception(_(u"E-Mail Address can't be empty and has to be a valid E-Mail"))
if new_email != content.email:
content.email = new_email
content.email = check_email(new_email)
# Query username, if not existing, change
if to_save.get("name", content.name) != content.name:
if to_save.get("name") == "Guest":

View File

@ -1364,11 +1364,11 @@ def change_profile(kobo_support, local_oauth_check, oauth_status, translations,
try:
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 = check_email(to_save.get("email", current_user.email))
new_email = valid_email(to_save.get("email", current_user.email))
if not new_email:
raise Exception(_(u"E-Mail Address can't be empty and has to be a valid E-Mail"))
if new_email != current_user.email:
current_user.email = new_email
current_user.email = check_email(new_email)
if current_user.role_admin():
if to_save.get("name", current_user.name) != current_user.name:
# Query username, if not existing, change