Преглед изворни кода

Fixed quoting of line breaks inside a CSV field

Jeremy Stretch пре 8 година
родитељ
комит
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))