mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
do different stuff if project name is specified
This commit is contained in:
parent
2852ad1d8e
commit
b8c4dbed56
1 changed files with 8 additions and 0 deletions
|
|
@ -1422,6 +1422,14 @@ def get_latest_version(asset_name, subset_name, dbcon=None, project_name=None):
|
|||
|
||||
# Check if subsets actually exists.
|
||||
assert subset, "No subsets found."
|
||||
if project_name and project_name != dbcon.Session.get("AVALON_PROJECT"):
|
||||
# `avalon.io` has only `_database` attribute
|
||||
# but `AvalonMongoDB` has `database`
|
||||
database = getattr(dbcon, "database", dbcon._database)
|
||||
collection = database[project_name]
|
||||
else:
|
||||
project_name = dbcon.Session.get("AVALON_PROJECT")
|
||||
collection = dbcon
|
||||
|
||||
# Get version
|
||||
version_projection = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue