Parsing error handling and MAC retrieval on new snapshots #27

Merged
pedro merged 12 commits from pr_25 into main 2024-11-12 13:57:05 +00:00
1 changed files with 9 additions and 1 deletions
Showing only changes of commit eb81b65e5b - Show all commits

View File

@ -130,7 +130,15 @@ class ImportForm(forms.Form):
data = self.cleaned_data["file_import"] data = self.cleaned_data["file_import"]
self.file_name = data.name self.file_name = data.name
try:
df = pd.read_excel(data) df = pd.read_excel(data)
except Exception as e:
raise ValidationError(
_("Error on '%(file_name)s': Invalid File"),
params={"file_name": self.file_name}
)
df.fillna('', inplace=True) df.fillna('', inplace=True)
data_pd = df.to_dict(orient='index') data_pd = df.to_dict(orient='index')