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

Fix the case where user cancels and re-subscribes
This commit is contained in:
Son Nguyen Kim 2020-03-03 05:09:26 +07:00 committed by GitHub
commit 0055934fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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()