mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fixed quoting of line breaks inside a CSV field
This commit is contained in:
parent
a9fefbec5c
commit
1890e710cb
@ -27,7 +27,7 @@ def csv_format(data):
|
|||||||
value = '{}'.format(value)
|
value = '{}'.format(value)
|
||||||
|
|
||||||
# Double-quote the value if it contains a comma
|
# Double-quote the value if it contains a comma
|
||||||
if ',' in value:
|
if ',' in value or '\n' in value:
|
||||||
csv.append('"{}"'.format(value))
|
csv.append('"{}"'.format(value))
|
||||||
else:
|
else:
|
||||||
csv.append('{}'.format(value))
|
csv.append('{}'.format(value))
|
||||||
|
Loading…
Reference in New Issue
Block a user