From de1a1a9f1a6cdd48ce03da600a170fbb5afb4195 Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Wed, 4 Sep 2024 16:46:34 +0200 Subject: [PATCH] fix --- src/depiction_targeted_preproc/pipeline/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/depiction_targeted_preproc/pipeline/run.py b/src/depiction_targeted_preproc/pipeline/run.py index 16d8d13..fab3573 100644 --- a/src/depiction_targeted_preproc/pipeline/run.py +++ b/src/depiction_targeted_preproc/pipeline/run.py @@ -72,8 +72,8 @@ def _set_workunit_processing(client: Bfabric, workunit_id: int) -> None: # TODO the default resource should be deleted in the future, but right now we simply set it to 0 and available # (it will not be possible before updated wrapper creator) resources = Resource.find_by({"name": "% - resource", "workunitid": workunit_id}, client=client, max_results=1) - if len(resources): - client.save("resource", {"id": resources[0].id, "status": "available"}) + if resources: + client.save("resource", {"id": list(resources.values())[0].id, "status": "available"}) def _set_workunit_available(client: Bfabric, workunit_id: int) -> None: