Browse Source

Fix the case where user cancels and re-subscribes

Son NK 5 years ago
parent
commit
930b4cadb9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      server.py

+ 4 - 0
server.py

@@ -379,6 +379,10 @@ def setup_paddle_callback(app: Flask):
                 ).date()
                 sub.plan = plan
 
+                # make sure to set the new plan as not-cancelled
+                # in case user cancels a plan and subscribes a new plan
+                sub.cancelled = False
+
             LOG.debug("User %s upgrades!", user)
 
             db.session.commit()