From 1890e710cb62ce5a0fcf79619287a6aa518bb3fc Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 2 Feb 2018 16:31:23 -0500 Subject: [PATCH] Fixed quoting of line breaks inside a CSV field --- netbox/utilities/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 84d6d444a..c08bfef8c 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -27,7 +27,7 @@ def csv_format(data): value = '{}'.format(value) # Double-quote the value if it contains a comma - if ',' in value: + if ',' in value or '\n' in value: csv.append('"{}"'.format(value)) else: csv.append('{}'.format(value))