diff --git a/ayon_api/_api_helpers/projects.py b/ayon_api/_api_helpers/projects.py index 86e003606..70099d29b 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 @@ -814,8 +815,20 @@ def _get_graphql_projects( if library is not None and library is not project["library"]: 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 b4287e625..1b4668218 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -2428,8 +2428,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