ソースを参照

Merge pull request #97 from simple-login/fix-cancel-subscribe

Fix the case where user cancels and re-subscribes
Son Nguyen Kim 5 年 前
コミット
0055934fc3
1 ファイル変更4 行追加0 行削除
  1. 4 0
      server.py

+ 4 - 0
server.py

@@ -379,6 +379,10 @@ def setup_paddle_callback(app: Flask):
                 ).date()
                 ).date()
                 sub.plan = plan
                 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)
             LOG.debug("User %s upgrades!", user)
 
 
             db.session.commit()
             db.session.commit()