Handle invalid email when user signs up

This commit is contained in:
Son NK 2020-03-21 11:11:52 +01:00
parent 8abdf655fc
commit b8093aefa3

View file

@ -46,7 +46,11 @@ def register():
user = User.create(email=email, name="", password=form.password.data) user = User.create(email=email, name="", password=form.password.data)
db.session.commit() db.session.commit()
send_activation_email(user, next_url) try:
send_activation_email(user, next_url)
except:
flash("Invalid email, are you sure the email is correct?", "error")
return redirect(url_for("auth.register"))
return render_template("auth/register_waiting_activation.html") return render_template("auth/register_waiting_activation.html")