Fix subscription might not exist

This commit is contained in:
Son NK 2020-01-01 23:51:22 +01:00
parent b8ca2d0158
commit 5d25310105

View file

@ -367,9 +367,9 @@ def setup_paddle_callback(app: Flask):
LOG.debug("Cancel subscription %s", subscription_id)
sub: Subscription = Subscription.get_by(subscription_id=subscription_id)
sub.cancelled = True
db.session.commit()
if sub:
sub.cancelled = True
db.session.commit()
return "OK"