diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-11-30 18:22:18 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-04-16 16:38:32 +0200 | 
| commit | a3fdb47d0ee424c65f4f73c2a679cde72ff27907 (patch) | |
| tree | 97ee2c8ca9a600275169ceaa0f9fddad1341b623 | |
| parent | 6293de21eea6381b2a72adf9cb10e33050bfee26 (diff) | |
| download | Ishtar-a3fdb47d0ee424c65f4f73c2a679cde72ff27907.tar.bz2 Ishtar-a3fdb47d0ee424c65f4f73c2a679cde72ff27907.zip | |
🐛 GIS imports - allow XLS and ODS format (refs #5669)
| -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 | 
