Browse Source

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

Fix the case where user cancels and re-subscribes
Son Nguyen Kim 5 năm trước cách đây
mục cha
commit
0055934fc3
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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()