From a1956cdd832a1eefb4812cf9552883fc3ffd765c Mon Sep 17 00:00:00 2001 From: clearml <> Date: Thu, 5 Dec 2024 22:16:14 +0200 Subject: [PATCH] When removing a task from a queue change the task state only if the task does not think that it is enqueued in some other place --- apiserver/bll/queue/queue_bll.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apiserver/bll/queue/queue_bll.py b/apiserver/bll/queue/queue_bll.py index ab8a357..1e67ad0 100644 --- a/apiserver/bll/queue/queue_bll.py +++ b/apiserver/bll/queue/queue_bll.py @@ -150,6 +150,7 @@ class QueueBLL(object): task = Task.get( company=company_id, id=task_id, + execution__queue=queue_id, _only=[ "id", "company", @@ -169,7 +170,10 @@ class QueueBLL(object): status_message="", user_id=user_id, force=True, - ).execute(enqueue_status=None) + ).execute( + enqueue_status=None, + unset__execution__queue=1, + ) except Exception as ex: log.error( f"Failed updating task {task_id} status on removal from queue: {queue_id}, {str(ex)}"