check if user has lifetime license on pricing page

This commit is contained in:
Son 2021-12-01 17:41:20 +01:00
parent 57ec92ed7c
commit e1123961cf
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,10 @@ from app.models import (
@dashboard_bp.route("/pricing", methods=["GET", "POST"])
@login_required
def pricing():
if current_user.lifetime:
flash("You already have a lifetime subscription", "error")
return redirect(url_for("dashboard.index"))
sub: Subscription = current_user.get_subscription()
# user who has canceled can re-subscribe
if sub and not sub.cancelled: