manager: only allow column headers on first line of CSV file

This commit is contained in:
Frédéric Péters 2016-09-16 15:28:09 +02:00
parent 43fd4e736f
commit a0aa2d6b5d
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ class ImportEventsForm(forms.Form):
continue
if len(csvline) < 3:
raise ValidationError(_('Invalid file format. (line %d)') % (i+1))
if csvline[0].strip('#') in ('date', 'Date', _('date'), _('Date')):
if i == 0 and csvline[0].strip('#') in ('date', 'Date', _('date'), _('Date')):
continue
event = Event()
for datetime_fmt in ('%Y-%m-%d %H:%M', '%d/%m/%Y %H:%M',