From 84f3d7c278a7cbdfbfd0191ac1c3244bb024a15d Mon Sep 17 00:00:00 2001 From: Son NK Date: Sun, 8 Mar 2020 11:36:09 +0100 Subject: [PATCH] TODO: add next_bill_date check on active subscription next April --- app/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models.py b/app/models.py index fe3cb7eb..10cffbb3 100644 --- a/app/models.py +++ b/app/models.py @@ -297,6 +297,10 @@ class User(db.Model, ModelMixin, UserMixin): TODO: support user unsubscribe and re-subscribe """ sub = Subscription.get_by(user_id=self.id) + # TODO: sub is active only if sub.next_bill_date > now + # due to a bug on next_bill_date, wait until next month (April 8) + # when all next_bill_date are correctly updated to add this check + if sub and sub.cancelled: # sub is active until the next billing_date + 1 if sub.next_bill_date >= arrow.now().shift(days=-1).date():