From 869d3365195c69dc06b1c2ab2b1b7de6ff0e443a Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 5 Jun 2024 22:14:39 +0800 Subject: [PATCH] code tweaks - big roy's comment --- client/ayon_core/pipeline/context_tools.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 8b72405048..ab44dd014e 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -624,10 +624,9 @@ def version_up_current_workfile(): work_root = work_template["directory"].format_strict(data) file_template = work_template["file"].template - last_workfile_path = get_last_workfile( + workfile_path = get_last_workfile( work_root, file_template, data, extensions, True ) - new_workfile_path = version_up(last_workfile_path) - if os.path.exists(new_workfile_path): - new_workfile_path = version_up(new_workfile_path) - host.save_workfile(new_workfile_path) + if os.path.exists(workfile_path): + workfile_path = version_up(workfile_path) + host.save_workfile(workfile_path)