From b1b16f76972523de024c94d6a4f5e02edb2e5ba1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 23 Feb 2024 10:15:32 +0100 Subject: [PATCH] fix #143 --- idhub/admin/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index aa453ce..360b596 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -195,7 +195,10 @@ class ImportForm(forms.Form): data_pd = df.fillna('').to_dict() 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): row = {}