mirror of
https://github.com/simple-login/app.git
synced 2024-09-29 21:21:29 +02:00
refactor
This commit is contained in:
parent
d9d67df126
commit
19088ba85f
@ -251,15 +251,15 @@ def cancel_mailbox_change_route(mailbox_id):
|
|||||||
@dashboard_bp.route("/mailbox/confirm_change")
|
@dashboard_bp.route("/mailbox/confirm_change")
|
||||||
def mailbox_confirm_change_route():
|
def mailbox_confirm_change_route():
|
||||||
s = Signer(MAILBOX_SECRET)
|
s = Signer(MAILBOX_SECRET)
|
||||||
mailbox_id = request.args.get("mailbox_id")
|
signed_mailbox_id = request.args.get("mailbox_id")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r_id = int(s.unsign(mailbox_id))
|
mailbox_id = int(s.unsign(signed_mailbox_id))
|
||||||
except Exception:
|
except Exception:
|
||||||
flash("Invalid link", "error")
|
flash("Invalid link", "error")
|
||||||
return redirect(url_for("dashboard.index"))
|
return redirect(url_for("dashboard.index"))
|
||||||
else:
|
else:
|
||||||
mailbox = Mailbox.get(r_id)
|
mailbox = Mailbox.get(mailbox_id)
|
||||||
|
|
||||||
# new_email can be None if user cancels change in the meantime
|
# new_email can be None if user cancels change in the meantime
|
||||||
if mailbox and mailbox.new_email:
|
if mailbox and mailbox.new_email:
|
||||||
|
Loading…
Reference in New Issue
Block a user