mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
OP-2951 - refactored to use AvalonMongoDB
This commit is contained in:
parent
fc4f7ed5d9
commit
eb1f72fccd
1 changed files with 7 additions and 6 deletions
|
|
@ -1990,13 +1990,14 @@ def get_linked_ids_for_representations(project_name, repre_ids, dbcon=None,
|
|||
Returns:
|
||||
(list) of ObjectId - linked representations
|
||||
"""
|
||||
# Create new dbcon if not passed and use passed project name
|
||||
if not dbcon:
|
||||
log.debug("Using `avalon.io` for query.")
|
||||
dbcon = avalon.io
|
||||
# Make sure is installed
|
||||
dbcon.install()
|
||||
|
||||
dbcon.Session["AVALON_PROJECT"] = project_name
|
||||
from avalon.api import AvalonMongoDB
|
||||
dbcon = AvalonMongoDB()
|
||||
dbcon.Session["AVALON_PROJECT"] = project_name
|
||||
# Validate that passed dbcon has same project
|
||||
elif dbcon.Session["AVALON_PROJECT"] != project_name:
|
||||
raise ValueError("Passed connection does not have right project")
|
||||
|
||||
if not isinstance(repre_ids, list):
|
||||
repre_ids = [repre_ids]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue