Fix email confirmation for users created through the superuser API
This commit is contained in:
parent
2b64b348b2
commit
edafa26e6e
2 changed files with 2 additions and 2 deletions
|
@ -541,7 +541,7 @@ def confirm_user_email(code):
|
||||||
|
|
||||||
old_email = None
|
old_email = None
|
||||||
new_email = code.new_email
|
new_email = code.new_email
|
||||||
if new_email:
|
if new_email and new_email != old_email:
|
||||||
if find_user_by_email(new_email):
|
if find_user_by_email(new_email):
|
||||||
raise DataModelException('E-mail address already used.')
|
raise DataModelException('E-mail address already used.')
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ class SuperUserList(ApiResource):
|
||||||
|
|
||||||
# If mailing is turned on, send the user a verification email.
|
# If mailing is turned on, send the user a verification email.
|
||||||
if features.MAILING:
|
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)
|
send_confirmation_email(user.username, user.email, confirmation.code)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Reference in a new issue