Pārlūkot izejas kodu

Fixes #1268: Fix CSV import error under Python 3

Jeremy Stretch 9 gadi atpakaļ
vecāks
revīzija
16d694734b
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      netbox/utilities/forms.py

+ 1 - 1
netbox/utilities/forms.py

@@ -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))