mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 14:37:36 +01:00
Fix verification email not being sent by set password
This commit is contained in:
parent
c4c8390ead
commit
cd39f7b2c6
@ -259,6 +259,12 @@ def handle_set_password(form):
|
|||||||
flash("That email address has been unsubscribed/blacklisted, and cannot be used", "danger")
|
flash("That email address has been unsubscribed/blacklisted, and cannot be used", "danger")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
user_by_email = User.query.filter_by(email=form.email.data).first()
|
||||||
|
if user_by_email:
|
||||||
|
send_anon_email.delay(form.email.data, "Email already in use",
|
||||||
|
"We were unable to create the account as the email is already in use by {}. Try a different email address.".format(
|
||||||
|
user_by_email.display_name))
|
||||||
|
else:
|
||||||
token = randomString(32)
|
token = randomString(32)
|
||||||
|
|
||||||
ver = UserEmailVerification()
|
ver = UserEmailVerification()
|
||||||
@ -266,6 +272,12 @@ def handle_set_password(form):
|
|||||||
ver.token = token
|
ver.token = token
|
||||||
ver.email = newEmail
|
ver.email = newEmail
|
||||||
db.session.add(ver)
|
db.session.add(ver)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
send_verify_email.delay(form.email.data, token)
|
||||||
|
|
||||||
|
flash("Your password has been changed successfully.", "success")
|
||||||
|
return redirect(url_for("flatpage", path="email_sent"))
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
flash("Your password has been changed successfully.", "success")
|
flash("Your password has been changed successfully.", "success")
|
||||||
|
Loading…
Reference in New Issue
Block a user