mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
use current project for query asset
This commit is contained in:
parent
5de8185ded
commit
9a8c41371b
1 changed files with 7 additions and 3 deletions
|
|
@ -409,6 +409,7 @@ class FamilyConfigCache:
|
|||
project_name = os.environ.get("AVALON_PROJECT")
|
||||
asset_name = os.environ.get("AVALON_ASSET")
|
||||
task_name = os.environ.get("AVALON_TASK")
|
||||
host_name = os.environ.get("AVALON_APP")
|
||||
if not all((project_name, asset_name, task_name)):
|
||||
return
|
||||
|
||||
|
|
@ -422,15 +423,18 @@ class FamilyConfigCache:
|
|||
["family_filter_profiles"]
|
||||
)
|
||||
if profiles:
|
||||
asset_doc = self.dbcon.find_one(
|
||||
# Make sure connection is installed
|
||||
# - accessing attribute which does not have auto-install
|
||||
self.dbcon.install()
|
||||
asset_doc = self.dbcon.database[project_name].find_one(
|
||||
{"type": "asset", "name": asset_name},
|
||||
{"data.tasks": True}
|
||||
)
|
||||
) or {}
|
||||
tasks_info = asset_doc.get("data", {}).get("tasks") or {}
|
||||
task_type = tasks_info.get(task_name, {}).get("type")
|
||||
profiles_filter = {
|
||||
"task_types": task_type,
|
||||
"hosts": os.environ["AVALON_APP"]
|
||||
"hosts": host_name
|
||||
}
|
||||
matching_item = filter_profiles(profiles, profiles_filter)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue