mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Closes #856: Strip whitespace from fields during CSV import
This commit is contained in:
parent
f4f41a5985
commit
8536f6c163
@ -252,6 +252,7 @@ class CSVDataField(forms.CharField):
|
||||
elif len(row) > len(self.columns):
|
||||
raise forms.ValidationError("Line {}: Too many fields (found {}; expected {})"
|
||||
.format(i, len(row), len(self.columns)))
|
||||
row = [col.strip() for col in row]
|
||||
record = dict(zip(self.columns, row))
|
||||
records.append(record)
|
||||
return records
|
||||
|
Loading…
Reference in New Issue
Block a user