Przeglądaj źródła

Fixes #7780: Preserve mutli-line values during CSV file import

jeremystretch 4 lat temu
rodzic
commit
d08ed9fe5f

+ 1 - 0
docs/release-notes/version-3.0.md

@@ -10,6 +10,7 @@
 
 
 * [#7752](https://github.com/netbox-community/netbox/issues/7752) - Fix minimum version check under Python v3.10
 * [#7752](https://github.com/netbox-community/netbox/issues/7752) - Fix minimum version check under Python v3.10
 * [#7766](https://github.com/netbox-community/netbox/issues/7766) - Add missing outer dimension columns to rack table
 * [#7766](https://github.com/netbox-community/netbox/issues/7766) - Add missing outer dimension columns to rack table
+* [#7780](https://github.com/netbox-community/netbox/issues/7780) - Preserve mutli-line values during CSV file import
 * [#7783](https://github.com/netbox-community/netbox/issues/7783) - Fix indentation of locations under site view
 * [#7783](https://github.com/netbox-community/netbox/issues/7783) - Fix indentation of locations under site view
 
 
 ---
 ---

+ 1 - 1
netbox/utilities/forms/fields.py

@@ -224,7 +224,7 @@ class CSVFileField(forms.FileField):
             return None
             return None
 
 
         csv_str = file.read().decode('utf-8').strip()
         csv_str = file.read().decode('utf-8').strip()
-        reader = csv.reader(csv_str.splitlines())
+        reader = csv.reader(StringIO(csv_str))
         headers, records = parse_csv(reader)
         headers, records = parse_csv(reader)
 
 
         return headers, records
         return headers, records