diff options
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 4065e1fa3..7ca808929 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -462,7 +462,7 @@ class NewImportGISForm(BaseImportForm): if value: try: ext = value.name.lower().split(".")[-1] - if ext not in ("zip", "gpkg", "csv"): + if ext not in ["zip", "gpkg", "csv", "ods", "xls", "xlsx", "xlsm"]: raise forms.ValidationError("") if ext == "zip": zip_file = zipfile.ZipFile(value) @@ -479,16 +479,14 @@ class NewImportGISForm(BaseImportForm): except forms.ValidationError: raise forms.ValidationError( _( - "GIS file must be a zip containing a ShapeFile or GeoPackage file." + "GIS file must be a table or a zip containing a ShapeFile or GeoPackage file." ) ) return value def clean(self): data = super().clean() - types = ["zip", "gpkg", "csv"] - if settings.USE_LIBREOFFICE: - types += [".ods", ".xls", ".xlsx", ".xlsm"] + types = [".zip", ".gpkg", ".csv", ".ods", ".xls", ".xlsx", ".xlsm"] self._clean_imported_file(types=types) return data |