From 2e4eb3781a8b0fc779e32ebedbe37e17a4e92025 Mon Sep 17 00:00:00 2001
From: felmer <franz-josef.elmer@id.ethz.ch>
Date: Thu, 19 Jan 2023 07:22:48 +0100
Subject: [PATCH] SSDM-12929: supress top level 'original' in data set file
 system view if there is no sibling

---
 .../eln-lims/1/dss/file-system-plugins/eln-tree/script.py    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/file-system-plugins/eln-tree/script.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/file-system-plugins/eln-tree/script.py
index ef3324634a0..18e055d1ba6 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/file-system-plugins/eln-tree/script.py
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/file-system-plugins/eln-tree/script.py
@@ -309,7 +309,10 @@ def addSampleChildNodes(path, samplePermId, response, acceptor, context):
     addNodes("SAMPLE", entitiesByName, path, response, context)
 
 def addDataSetFileNodes(path, dataSetCode, contentNode, response, acceptor, context):
-    for childNode in contentNode.getChildNodes():
+    childNodes = contentNode.getChildNodes()
+    if len(childNodes) == 1 and childNodes[0].getRelativePath() == 'original':
+        childNodes = childNodes[0].getChildNodes()
+    for childNode in childNodes:
         nodeName = childNode.getName()
         filePath = "%s/%s" % (path, nodeName)
         filePermId = "%s::%s" % (dataSetCode, childNode.getRelativePath())
-- 
GitLab