Optimize tasks.move

This commit is contained in:
clearml 2024-12-05 22:24:40 +02:00
parent 77e7fb5c13
commit 073cc96fb8

View File

@ -1478,10 +1478,11 @@ def move(call: APICall, company_id: str, request: MoveRequest):
"project or project_name is required" "project or project_name is required"
) )
_assert_writable_tasks(company_id, call.identity, request.ids) tasks = _assert_writable_tasks(
updated_projects = set( company_id, call.identity, request.ids, only=("id", "project")
t.project for t in Task.objects(id__in=request.ids).only("project") if t.project
) )
updated_projects = set(t.project for t in tasks if t.project)
project_id = project_bll.move_under_project( project_id = project_bll.move_under_project(
entity_cls=Task, entity_cls=Task,
user=call.identity.user, user=call.identity.user,