Handle if VM_ID metadata is not set

This commit is contained in:
PCoder 2019-04-03 07:32:18 +02:00
parent dbf3b92c06
commit 66ffbf38aa

View file

@ -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