From 033db01810643f9c9129b57103269ee7622b70cf Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 3 Apr 2019 06:51:19 +0200 Subject: [PATCH] Correct error in getting lines data count --- utils/stripe_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 53346626..834b2201 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -151,7 +151,7 @@ class StripeUtils(object): 'total': invoice.total, # to see how many line items we have in this invoice and # then later check if we have more than 1 - 'lines_data_count': len(invoice.lines.data), + 'lines_data_count': len(invoice.lines.data) if invoice.lines.data is not None else 0, 'invoice_id': invoice.id, 'lines_meta_data_csv': ','.join( [line.metadata.VM_ID if line.metadata.VM_ID is not None else '' for line in invoice.lines.data]