Skip to content

Commit 5c6c4af

Browse files
committed
Return deleted stripe objects
1 parent ea66bc0 commit 5c6c4af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readthedocs/payments/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def delete_customer(customer_id):
1414
"""Delete customer from Stripe, cancelling subscriptions"""
1515
try:
1616
customer = stripe.Customer.retrieve(customer_id)
17-
customer.delete()
17+
return customer.delete()
1818
except stripe.error.InvalidRequestError:
1919
pass
2020

@@ -25,6 +25,6 @@ def cancel_subscription(customer_id, subscription_id):
2525
customer = stripe.Customer.retrieve(customer_id)
2626
if hasattr(customer, 'subscriptions'):
2727
subscription = customer.subscriptions.retrieve(subscription_id)
28-
subscription.delete()
28+
return subscription.delete()
2929
except stripe.error.StripeError:
3030
pass

0 commit comments

Comments
 (0)