This commit is contained in:
Cayo Puigdefabregas 2024-02-23 10:15:32 +01:00
parent 57be4dca2e
commit b1b16f7697
1 changed files with 4 additions and 1 deletions

View File

@ -195,7 +195,10 @@ class ImportForm(forms.Form):
data_pd = df.fillna('').to_dict() data_pd = df.fillna('').to_dict()
if not data_pd: if not data_pd:
self.exception("This file is empty!") self.exception(_("This file is empty!"))
if not df.last_valid_index():
self.exception(_("This file is badly formatted!"))
for n in range(df.last_valid_index()+1): for n in range(df.last_valid_index()+1):
row = {} row = {}