Fix update to latest - it now updates to latest instead of hero version

This commit is contained in:
Roy Nieterau 2024-03-19 23:56:54 +01:00
parent 5ee980041a
commit 7b5b2a980c

View file

@ -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"]