From b7f3f31dbb78a82ea5f12e563bf9c5a2a05190f5 Mon Sep 17 00:00:00 2001 From: Mehmed Mustafa Date: Mon, 9 Dec 2024 13:56:23 +0100 Subject: [PATCH] fix: bug of removing wrong file groups --- src/server/operandi_server/routers/workflow.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/operandi_server/routers/workflow.py b/src/server/operandi_server/routers/workflow.py index 02d818f..0c0833a 100644 --- a/src/server/operandi_server/routers/workflow.py +++ b/src/server/operandi_server/routers/workflow.py @@ -395,12 +395,16 @@ async def submit_to_rabbitmq_queue( db_workflow = await get_db_workflow_with_handling(self.logger, workflow_id=workflow_id) if preserve_file_grps: self.logger.info(f"Finding file groups to be removed based on the reproducible/preserve file groups") - self.logger.info(f"preserve_file_grps: {preserve_file_grps}") remove_file_grps = find_file_groups_to_remove_with_handling(self.logger, db_workspace, preserve_file_grps) remove_file_grps = ",".join(remove_file_grps) self.logger.info(f"remove_file_grps: {remove_file_grps}") - file_grps_reproducible = ",".join(db_workflow.producible_file_groups) - remove_file_grps += f",{file_grps_reproducible}" + list_preserver_file_grps = preserve_file_grps.split(',') + remove_file_grps_reproducible = [] + for file_group in db_workflow.producible_file_groups: + if file_group not in list_preserver_file_grps: + remove_file_grps_reproducible.append(file_group) + if len(remove_file_grps_reproducible) > 0: + remove_file_grps += f",{','.join(remove_file_grps_reproducible)}" self.logger.info(f"remove_file_grps including reproducible: {remove_file_grps}") try: