From e9d03d1d4bb98e9c06ff034879eb6e996aeb8d80 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Wed, 6 May 2020 10:06:05 +0200 Subject: [PATCH] Handle the case where a deleted mailbox verification link is clicked --- app/dashboard/views/mailbox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/dashboard/views/mailbox.py b/app/dashboard/views/mailbox.py index 32d876f2..1174d5fe 100644 --- a/app/dashboard/views/mailbox.py +++ b/app/dashboard/views/mailbox.py @@ -150,6 +150,10 @@ def mailbox_verify(): return redirect(url_for("dashboard.mailbox_route")) else: mailbox = Mailbox.get(r_id) + if not mailbox: + flash("Invalid link", "error") + return redirect(url_for("dashboard.mailbox_route")) + mailbox.verified = True db.session.commit()