From a0dac8d1e500869c639837b5c6282892449fdd7b Mon Sep 17 00:00:00 2001 From: Alice Date: Sun, 1 Sep 2019 22:23:19 +0200 Subject: [PATCH] Irreproducible bug fixing attempt --- payments/backends/stripe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/payments/backends/stripe.py b/payments/backends/stripe.py index 3d74877..b8c4d1e 100644 --- a/payments/backends/stripe.py +++ b/payments/backends/stripe.py @@ -211,7 +211,10 @@ class StripeBackend(BackendBase): payment.paid_amount = payment.amount payment.backend_extid = invoice['id'] if invoice['subscription']: - payment.backend_sub_id = invoice['subscription']['id'] + if isinstance(invoice['subscription'], str): + payment.backend_sub_id = invoice['subscription'] + else: + payment.backend_sub_id = invoice['subscription']['id'] payment.backend_data = {'event_id': event['id']} payment.save()