Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Fix last version function #3345

Merged
merged 2 commits into from
Jun 15, 2022
Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jun 15, 2022

Brief description

Function get_last_verisons does not crash if fields are passed and do not contain "parent" key.

Description

Missing "parent" key was not added to required fields properly.

Testing notes:

Bug was spotted in standalone publisher where in specific cases is called this function.

It is possible to test in Tray > Admin > Console

from openpype.client import get_last_versions, get_subsets

# Fill your project name
project_name = "some project name"

# Find any random subset
any_subset = None
for subset in get_subsets(project_name):
    any_subset = subset
    break

# Run fixed function with fields that don't have "parent" key
# - this line should not crash
versions = get_last_versions(project_name, [any_subset["_id"]], fields=["name"])

@iLLiCiTiT iLLiCiTiT self-assigned this Jun 15, 2022
@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Jun 15, 2022
@iLLiCiTiT iLLiCiTiT requested a review from kalisp June 15, 2022 14:16
@iLLiCiTiT iLLiCiTiT merged commit 817fbef into develop Jun 15, 2022
@iLLiCiTiT iLLiCiTiT deleted the bugfix/fix_last_vesrsion_query branch June 15, 2022 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants