diff --git a/data/model/legacy.py b/data/model/legacy.py index 5188a9710..3bb928dbc 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -541,7 +541,7 @@ def confirm_user_email(code): old_email = None new_email = code.new_email - if new_email: + if new_email and new_email != old_email: if find_user_by_email(new_email): raise DataModelException('E-mail address already used.') diff --git a/endpoints/api/superuser.py b/endpoints/api/superuser.py index a391b3130..2c7daf633 100644 --- a/endpoints/api/superuser.py +++ b/endpoints/api/superuser.py @@ -190,7 +190,7 @@ class SuperUserList(ApiResource): # If mailing is turned on, send the user a verification email. if features.MAILING: - confirmation = model.create_confirm_email_code(user, new_email=user.email) + confirmation = model.create_confirm_email_code(user) send_confirmation_email(user.username, user.email, confirmation.code) return {