Handle the case where a deleted mailbox verification link is clicked

This commit is contained in:
Son NK 2020-05-06 10:06:05 +02:00
parent 103418dff7
commit e9d03d1d4b

View file

@ -150,6 +150,10 @@ def mailbox_verify():
return redirect(url_for("dashboard.mailbox_route")) return redirect(url_for("dashboard.mailbox_route"))
else: else:
mailbox = Mailbox.get(r_id) mailbox = Mailbox.get(r_id)
if not mailbox:
flash("Invalid link", "error")
return redirect(url_for("dashboard.mailbox_route"))
mailbox.verified = True mailbox.verified = True
db.session.commit() db.session.commit()