From c07c2a3aeb29d239e6f295d205d7e5c3da599acb Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:56:08 +0200 Subject: [PATCH] fix fill of own attrib for project --- ayon_api/_api_helpers/projects.py | 18 ++++++++++++++++-- ayon_api/server_api.py | 7 +++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ayon_api/_api_helpers/projects.py b/ayon_api/_api_helpers/projects.py index 65513d7d7..d583cf62e 100644 --- a/ayon_api/_api_helpers/projects.py +++ b/ayon_api/_api_helpers/projects.py @@ -1,5 +1,6 @@ from __future__ import annotations +import copy import json import platform import warnings @@ -810,8 +811,21 @@ def _get_graphql_projects( for project in parsed_data["projects"]: if active is not None and active is not project["active"]: continue - if own_attributes: - fill_own_attribs(project) + + all_attrib = project.get("allAttrib") + if isinstance(all_attrib, str): + all_attrib = json.loads(all_attrib) + project["allAttrib"] = all_attrib + + if own_attributes and all_attrib: + own_attrib = {} + if all_attrib: + own_attrib = copy.deepcopy(all_attrib) + attrib = project.get("attrib", {}) + for key in attrib.keys(): + own_attrib.setdefault(key, None) + project["ownAttrib"] = own_attrib + self._fill_project_entity_data(project) yield project diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 6b007c26b..8a730b907 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -2425,8 +2425,11 @@ def _prepare_fields( fields.remove("attrib") fields |= self.get_attributes_fields_for_type(entity_type) - if own_attributes and entity_type in {"project", "folder", "task"}: - fields.add("ownAttrib") + if own_attributes: + if entity_type == "project": + fields.add("allAttrib") + elif entity_type in {"folder", "task"}: + fields.add("ownAttrib") if entity_type != "project": return