fix #185 no schema select

This commit is contained in:
Cayo Puigdefabregas 2024-03-11 16:54:22 +01:00
parent 94334c9c0e
commit 0eec5d40a1
1 changed files with 3 additions and 3 deletions

View File

@ -217,13 +217,13 @@ class ImportForm(forms.Form):
return data return data
def clean_file_import(self): def clean_file_import(self):
props = self.json_schema.get("properties", {})
data = self.cleaned_data["file_import"] data = self.cleaned_data["file_import"]
self.file_name = data.name
if not self._schema: if not self._schema:
return data return data
self.file_name = data.name
props = self.json_schema.get("properties", {})
# Forze than pandas read one column as string # Forze than pandas read one column as string
dtype_dict = {"phoneNumber": str} dtype_dict = {"phoneNumber": str}
df = pd.read_excel(data, dtype=dtype_dict) df = pd.read_excel(data, dtype=dtype_dict)