Correct error in getting lines data count

This commit is contained in:
PCoder 2019-04-03 06:51:19 +02:00
parent 3eaa53ca78
commit 033db01810

View file

@ -151,7 +151,7 @@ class StripeUtils(object):
'total': invoice.total, 'total': invoice.total,
# to see how many line items we have in this invoice and # to see how many line items we have in this invoice and
# then later check if we have more than 1 # 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, 'invoice_id': invoice.id,
'lines_meta_data_csv': ','.join( '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 line.metadata.VM_ID is not None else '' for line in invoice.lines.data]