Просмотр исходного кода

Fixed quoting of line breaks inside a CSV field

Jeremy Stretch 8 лет назад
Родитель
Сommit
1890e710cb
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      netbox/utilities/utils.py

+ 1 - 1
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))