diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-11-09 12:19:56 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-05 10:51:52 +0100 |
commit | f56fd82f15ab167f722e568b781427d0fb28535e (patch) | |
tree | 1f9d83127cb9333c31fffaaed251f9861c0f8cbb /ishtar_common | |
parent | ddd68ea0677fcc29da7169f609398c9c00aa4334 (diff) | |
download | Ishtar-f56fd82f15ab167f722e568b781427d0fb28535e.tar.bz2 Ishtar-f56fd82f15ab167f722e568b781427d0fb28535e.zip |
✨ imports: add xlsm to available extensions
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/forms_common.py | 4 | ||||
-rw-r--r-- | ishtar_common/models_imports.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 0d739fbfb..993b03766 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -396,7 +396,7 @@ class NewImportForm(BaseImportForm): ) types = [".csv"] if settings.USE_LIBREOFFICE: - types += [".ods", ".xls", ".xlsx"] + types += [".ods", ".xls", ".xlsx", ".xlsm"] self._clean_imported_file(types=types) archive_required = self._need_archive(data) if archive_required and ( @@ -490,7 +490,7 @@ class NewImportGISForm(BaseImportForm): data = super().clean() types = ["zip", "gpkg", "csv"] if settings.USE_LIBREOFFICE: - types += [".ods", ".xls", ".xlsx"] + types += [".ods", ".xls", ".xlsx", ".xlsm"] self._clean_imported_file(types=types) return data diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index 2967c18aa..6cb95b0ee 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -2119,7 +2119,8 @@ class Import(BaseImport): if not settings.USE_LIBREOFFICE or not self.imported_file or not UnoCalc: return name = self.imported_file.name.lower() - if not name.endswith(".ods") and not name.endswith(".xls") and not name.endswith(".xlsx"): + ext = name.split(".")[-1] + if ext not in ("ods", "xls", "xlsx", "xlsm"): return imported_file_path = os.path.abspath(self.imported_file.path) media_root = os.path.abspath(settings.MEDIA_ROOT) |