浏览代码

do not use next_bill_date to know whether user is premium

Son NK 5 年之前
父节点
当前提交
034605d9ac
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models.py

+ 1 - 1
app/models.py

@@ -128,7 +128,7 @@ class User(db.Model, ModelMixin, UserMixin):
     def is_premium(self):
         """user is premium if they have a active subscription"""
         sub: Subscription = self.get_subscription()
-        return sub is not None and sub.next_bill_date > arrow.now().date()
+        return sub is not None and not sub.cancelled
 
     def is_trial(self):
         return self.trial_expiration is not None and self.trial_expiration > arrow.now()