From 7b5b2a980cf68afd3fa5e8051b0e15d9f88d913f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 19 Mar 2024 23:56:54 +0100 Subject: [PATCH] Fix update to latest - it now updates to latest instead of hero version --- client/ayon_core/pipeline/load/utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/pipeline/load/utils.py b/client/ayon_core/pipeline/load/utils.py index f3d39800cd..66ead70c14 100644 --- a/client/ayon_core/pipeline/load/utils.py +++ b/client/ayon_core/pipeline/load/utils.py @@ -479,10 +479,15 @@ def update_container(container, version=-1): project_name, current_version["productId"] ) elif version == -1: - new_version = ayon_api.get_last_version_by_product_id( - project_name, current_version["productId"] - ) - + # TODO: Use `ayon_api.get_last_version_by_product_id` when fixed + # to not return hero versions instead of the last version + new_version = next(ayon_api.get_versions( + project_name, + product_ids=[current_version["productId"]], + standard=True, + hero=False, + latest=True, + ), None) else: new_version = ayon_api.get_version_by_name( project_name, version, current_version["productId"]