ソースを参照

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):
     def is_premium(self):
         """user is premium if they have a active subscription"""
         """user is premium if they have a active subscription"""
         sub: Subscription = self.get_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):
     def is_trial(self):
         return self.trial_expiration is not None and self.trial_expiration > arrow.now()
         return self.trial_expiration is not None and self.trial_expiration > arrow.now()