Skip to content

Commit 80376bb

Browse files
committed
fix optional graphql keys
1 parent fab4d3c commit 80376bb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ayon_api/_api_helpers/projects.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,13 @@ def get_projects(
273273
for project in self.get_rest_projects(active, library):
274274
name = project["name"]
275275
graphql_p = projects_by_name.get(name)
276-
if graphql_p and "productTypes" in graphql_p:
277-
project["productTypes"] = graphql_p["productTypes"]
276+
if graphql_p:
277+
for key in (
278+
"productTypes",
279+
"usedTags",
280+
):
281+
if key in graphql_p:
282+
project[key] = graphql_p[key]
278283
yield project
279284

280285
def get_project(
@@ -316,7 +321,12 @@ def get_project(
316321
if own_attributes:
317322
fill_own_attribs(project)
318323
if graphql_project:
319-
project["productTypes"] = graphql_project["productTypes"]
324+
for key in (
325+
"productTypes",
326+
"usedTags",
327+
):
328+
if key in graphql_project:
329+
project[key] = graphql_project[key]
320330
return project
321331

322332
def create_project(

0 commit comments

Comments
 (0)