From d6ae1db1b64becb58ac4daef9f2a01fbdbdde707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 6 May 2024 13:43:14 +0200 Subject: [PATCH] :recycle: refactor var name and the logic a little bit --- client/ayon_core/pipeline/create/context.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/client/ayon_core/pipeline/create/context.py b/client/ayon_core/pipeline/create/context.py index e66e15b8b1..dd005d250c 100644 --- a/client/ayon_core/pipeline/create/context.py +++ b/client/ayon_core/pipeline/create/context.py @@ -1988,16 +1988,12 @@ class CreateContext: ) if task_entity is None: - task_name = self.get_current_task_name() - if task_name: + current_task_name = self.get_current_task_name() + if current_task_name: task_entity = ayon_api.get_task_by_name( - project_name, folder_entity["id"], task_name + project_name, folder_entity["id"], current_task_name ) - task_name = None - if task_entity: - task_name = task_entity["name"] - if pre_create_data is None: pre_create_data = {} @@ -2022,11 +2018,10 @@ class CreateContext: instance_data = { "folderPath": folder_entity["path"], - "task": task_name, + "task": task_entity["name"] if task_entity else None, "productType": creator.product_type, "variant": variant } - print("Create instance data", instance_data) return creator.create( product_name, instance_data,