mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
fix last version check
This commit is contained in:
parent
29f0dee272
commit
a600cf4dca
1 changed files with 8 additions and 8 deletions
|
|
@ -116,19 +116,19 @@ class CopyLastPublishedWorkfile(PreLaunchHook):
|
|||
return
|
||||
|
||||
# Get workfile representation
|
||||
last_version_doc = get_last_version_by_subset_id(
|
||||
project_name, subset_id, fields=["_id"]
|
||||
)
|
||||
if not last_version_doc:
|
||||
self.log.debug("Subset does not have any versions")
|
||||
return
|
||||
|
||||
workfile_representation = next(
|
||||
(
|
||||
representation
|
||||
for representation in get_representations(
|
||||
project_name,
|
||||
version_ids=[
|
||||
(
|
||||
get_last_version_by_subset_id(
|
||||
project_name, subset_id, fields=["_id"]
|
||||
)
|
||||
or {}
|
||||
).get("_id")
|
||||
],
|
||||
version_ids=[last_version_doc["_id"]]
|
||||
)
|
||||
if representation["context"]["task"]["name"] == task_name
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue