From 4c519334f09992141b48c5ba9d2ee4e04ca38b12 Mon Sep 17 00:00:00 2001
From: juanf <juanf@ethz.ch>
Date: Wed, 22 Mar 2023 13:13:03 +0100
Subject: [PATCH] SSDM-13422: XLSX files support

---
 .../core-plugins/admin/1/as/services/xls-import/xls-import.py  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui-admin/src/core-plugins/admin/1/as/services/xls-import/xls-import.py b/ui-admin/src/core-plugins/admin/1/as/services/xls-import/xls-import.py
index 631c5649d7a..5df04a87afb 100644
--- a/ui-admin/src/core-plugins/admin/1/as/services/xls-import/xls-import.py
+++ b/ui-admin/src/core-plugins/admin/1/as/services/xls-import/xls-import.py
@@ -56,6 +56,9 @@ def process(context, parameters):
             tempPath = temp.getAbsolutePath()
             MasterDataRegistrationHelper.extractToDestination(zip_bytes, tempPath)
             byteArrays = MasterDataRegistrationHelper.getByteArrays(Path.of(tempPath), ".xls")
+            byteArrays.addAll(MasterDataRegistrationHelper.getByteArrays(Path.of(tempPath), ".xlsx"))
+            if len(byteArrays) == 0:
+                raise UserFailureException('No .xls or .xlsx fields found. These should be on the root folder of the zip file.')
             parameters.put('xls', byteArrays)
             allScripts = MasterDataRegistrationHelper.getAllScripts(Path.of(tempPath))
             parameters.put('scripts', allScripts)
-- 
GitLab