From 95d6fa347815fc154048a42da7d2dcb866da8389 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sat, 3 Jul 2021 17:11:54 +0200 Subject: [PATCH] make sure user can create new alias to receive an alias transfer --- app/dashboard/views/alias_transfer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/dashboard/views/alias_transfer.py b/app/dashboard/views/alias_transfer.py index 676e0adc..800243e3 100644 --- a/app/dashboard/views/alias_transfer.py +++ b/app/dashboard/views/alias_transfer.py @@ -142,6 +142,15 @@ def alias_transfer_receive_route(): flash("You already own this alias", "warning") return redirect(url_for("dashboard.index")) + # check if user has not exceeded the alias quota + if not current_user.can_create_new_alias(): + LOG.d("%s can't receive new alias", current_user) + flash( + "You have reached free plan limit, please upgrade to create new aliases", + "warning", + ) + return redirect(url_for("dashboard.index")) + mailboxes = current_user.mailboxes() if request.method == "POST":