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
1 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,11 @@ def register():
user = User.create(email=email, name="", password=form.password.data)
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")