small refactoring (#1120)

This commit is contained in:
Son Nguyen Kim 2022-06-28 17:21:23 +02:00 committed by GitHub
parent aac493ad2f
commit 75c710a6ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 24 deletions

View file

@ -32,9 +32,9 @@ def pricing():
flash("You already have a lifetime subscription", "error")
return redirect(url_for("dashboard.index"))
sub: Subscription = current_user.get_paddle_subscription()
paddle_sub: Subscription = current_user.get_paddle_subscription()
# user who has canceled can re-subscribe
if sub and not sub.cancelled:
if paddle_sub and not paddle_sub.cancelled:
flash("You already have an active subscription", "error")
return redirect(url_for("dashboard.index"))