mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 04:56:29 -06:00
Fixes #1268: Fix CSV import error under Python 3
This commit is contained in:
parent
252ab0fbab
commit
16d694734b
@ -249,7 +249,7 @@ class CSVDataField(forms.CharField):
|
|||||||
reader = csv.reader(value.splitlines())
|
reader = csv.reader(value.splitlines())
|
||||||
|
|
||||||
# Consume and valdiate the first line of CSV data as column headers
|
# Consume and valdiate the first line of CSV data as column headers
|
||||||
headers = reader.next()
|
headers = next(reader)
|
||||||
for f in self.required_fields:
|
for f in self.required_fields:
|
||||||
if f not in headers:
|
if f not in headers:
|
||||||
raise forms.ValidationError('Required column header "{}" not found.'.format(f))
|
raise forms.ValidationError('Required column header "{}" not found.'.format(f))
|
||||||
|
Loading…
Reference in New Issue
Block a user