mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Merge pull request #3042 from pypeclub/bugfix/library_loader_query_from_right_project
LibraryLoader: Use current project for asset query in families filter
This commit is contained in:
commit
6e05a3afdf
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