From 66ffbf38aa729ba753878bcccb6b799fb4f58582 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 3 Apr 2019 07:32:18 +0200 Subject: [PATCH] Handle if VM_ID metadata is not set --- 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 834b2201..7211465a 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -154,7 +154,7 @@ class StripeUtils(object): '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] + [line.metadata.VM_ID if hasattr(line.metadata, 'VM_ID') else '' for line in invoice.lines.data] ) } starting_after = invoice.id