make sure user can create new alias to receive an alias transfer

This commit is contained in:
Son NK 2021-07-03 17:11:54 +02:00
parent 9a9da53a58
commit 95d6fa3478
1 changed files with 9 additions and 0 deletions

View File

@ -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":