Private
Public Access
1
0

fix subscription cancel webhook

This commit is contained in:
Sander Roosendaal
2021-02-09 19:05:57 +01:00
parent c63b538cb7
commit 0b1cc2403f
2 changed files with 2 additions and 1 deletions

View File

@@ -68,6 +68,8 @@ def process_webhook(notification):
subscription = notification.subscription
rs = Rower.objects.filter(subscription_id=subscription.id)
if rs.count() == 0:
with open('braintreewebhooks.log','a') as f:
f.write('Could not find rowers with subscription ID '+subscription.id+'\n')
return 0
r = rs[0]
result,mesg,errormsg = cancel_subscription(r,subscription.id)