1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #1268: Fix CSV import error under Python 3

This commit is contained in:
Jeremy Stretch
2017-06-14 09:55:52 -04:00
parent 252ab0fbab
commit 16d694734b

View File

@ -249,7 +249,7 @@ class CSVDataField(forms.CharField):
reader = csv.reader(value.splitlines())
# Consume and valdiate the first line of CSV data as column headers
headers = reader.next()
headers = next(reader)
for f in self.required_fields:
if f not in headers:
raise forms.ValidationError('Required column header "{}" not found.'.format(f))