Skip to content

Commit

Permalink
return id to find folder #181
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCladellas committed Dec 10, 2024
1 parent 485afea commit d3ef1db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/feelpp/benchmarking/report/config/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ def upload(self, file_pattern, parent_id,leaf_folder_as_items=True,reuse_existin

if return_id:
items = list(self.client.listItem(folderId=parent_id, name=os.path.basename(file_pattern)))
assert len(items) >0, f"File not Found in Girder with the name {os.path.basename(file_pattern)}"
if len(items) == 0:
items = list(self.client.listFolder(parentId=parent_id, name=os.path.basename(file_pattern)))
assert len(items) <=1, f"More than one file found with the same name {os.path.basename(file_pattern)}"
assert len(items) >0, f"File not Found in Girder with the name {os.path.basename(file_pattern)}"
return items[0]["_id"]

class ConfigHandler:
Expand Down

0 comments on commit d3ef1db

Please sign in to comment.