Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ayon_api/_api_helpers/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,11 @@ def get_folders(
fields = self.get_default_fields_for_type("folder")
else:
fields = set(fields)
self._prepare_fields("folder", fields)
self._prepare_fields("folder", fields, own_attributes)

if active is not None:
fields.add("active")

if own_attributes:
fields.add("ownAttrib")

self._prepare_link_fields(fields)

query = folders_graphql_query(fields)
Expand Down
4 changes: 4 additions & 0 deletions ayon_api/_api_helpers/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ def get_projects(
"""
if fields is not None:
fields = set(fields)
if own_attributes:
fields.add("attrib")

graphql_fields, fetch_type = self._get_project_graphql_fields(fields)
if fetch_type == ProjectFetchType.RESTList:
Expand Down Expand Up @@ -358,6 +360,8 @@ def get_project(
"""
if fields is not None:
fields = set(fields)
if own_attributes:
fields.add("attrib")

graphql_fields, fetch_type = self._get_project_graphql_fields(fields)
graphql_project = None
Expand Down
4 changes: 2 additions & 2 deletions ayon_api/_api_helpers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_tasks(
fields = self.get_default_fields_for_type("task")
else:
fields = set(fields)
self._prepare_fields("task", fields, own_attributes)
self._prepare_fields("task", fields, own_attributes)

if active is not None:
fields.add("active")
Expand Down Expand Up @@ -253,7 +253,6 @@ def get_tasks_by_folder_paths(
fields = self.get_default_fields_for_type("task")
else:
fields = set(fields)
self._prepare_fields("task", fields, own_attributes)

fields.add("folderId")

Expand All @@ -269,6 +268,7 @@ def get_tasks_by_folder_paths(
active=active,
filters=filters,
fields=fields,
own_attributes=own_attributes,
):
folder_id = task_entity["folderId"]
folder_path = folder_path_by_id[folder_id]
Expand Down
2 changes: 2 additions & 0 deletions ayon_api/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2842,6 +2842,8 @@ def _prepare_fields(
if entity_type == "project":
add_all_attrib = True
elif entity_type in {"folder", "task"}:
# Attribute values are needed to fill 'ownAttrib'
add_all_attrib = True
fields.add("ownAttrib")

if add_all_attrib:
Expand Down
2 changes: 1 addition & 1 deletion ayon_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def fill_own_attribs(entity: AnyEntityDict) -> None:
entity (dict): Entity dictionary.

"""
if not entity or not entity.get("attrib"):
if not entity or entity.get("attrib") is None:
return

attributes = entity.get("ownAttrib")
Expand Down
Loading