Skip to content

Commit 6f04caa

Browse files
authored
Merge branch 'develop' into enhancement/bump-required-launcher
2 parents 6887e7b + cd4ba22 commit 6f04caa

6 files changed

Lines changed: 6 additions & 78 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ body:
3535
label: Version
3636
description: What version are you running? Look to AYON Tray
3737
options:
38+
- 1.8.8
3839
- 1.8.7
3940
- 1.8.6
4041
- 1.8.5

client/ayon_core/tools/common_models/users.py

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,12 @@
1-
import json
2-
import collections
31
from typing import Optional
42

53
import ayon_api
6-
from ayon_api.graphql import FIELD_VALUE, GraphQlQuery, fields_to_dict
74

85
from ayon_core.lib import NestedCacheItem, get_ayon_username
96

107
NOT_SET = object()
118

129

13-
# --- Implementation that should be in ayon-python-api ---
14-
# The implementation is not available in all versions of ayon-python-api.
15-
def users_graphql_query(fields):
16-
query = GraphQlQuery("Users")
17-
names_var = query.add_variable("userNames", "[String!]")
18-
project_name_var = query.add_variable("projectName", "String!")
19-
20-
users_field = query.add_field_with_edges("users")
21-
users_field.set_filter("names", names_var)
22-
users_field.set_filter("projectName", project_name_var)
23-
24-
nested_fields = fields_to_dict(set(fields))
25-
26-
query_queue = collections.deque()
27-
for key, value in nested_fields.items():
28-
query_queue.append((key, value, users_field))
29-
30-
while query_queue:
31-
item = query_queue.popleft()
32-
key, value, parent = item
33-
field = parent.add_field(key)
34-
if value is FIELD_VALUE:
35-
continue
36-
37-
for k, v in value.items():
38-
query_queue.append((k, v, field))
39-
return query
40-
41-
42-
def get_users(project_name=None, usernames=None, fields=None):
43-
"""Get Users.
44-
45-
Only administrators and managers can fetch all users. For other users
46-
it is required to pass in 'project_name' filter.
47-
48-
Args:
49-
project_name (Optional[str]): Project name.
50-
usernames (Optional[Iterable[str]]): Filter by usernames.
51-
fields (Optional[Iterable[str]]): Fields to be queried
52-
for users.
53-
54-
Returns:
55-
Generator[dict[str, Any]]: Queried users.
56-
57-
"""
58-
filters = {}
59-
if usernames is not None:
60-
usernames = set(usernames)
61-
if not usernames:
62-
return
63-
filters["userNames"] = list(usernames)
64-
65-
if project_name is not None:
66-
filters["projectName"] = project_name
67-
68-
con = ayon_api.get_server_api_connection()
69-
if not fields:
70-
fields = con.get_default_fields_for_type("user")
71-
72-
query = users_graphql_query(set(fields))
73-
for attr, filter_value in filters.items():
74-
query.set_variable_value(attr, filter_value)
75-
76-
for parsed_data in query.continuous_query(con):
77-
for user in parsed_data["users"]:
78-
user["accessGroups"] = json.loads(user["accessGroups"])
79-
yield user
80-
# --- END of ayon-python-api implementation ---
81-
82-
8310
class UserItem:
8411
def __init__(
8512
self,
@@ -172,5 +99,5 @@ def _invalidate_cache(self, project_name):
17299

173100
self._users_cache[project_name].update_data([
174101
UserItem.from_entity_data(user)
175-
for user in get_users(project_name)
102+
for user in ayon_api.get_users(project_name=project_name)
176103
])

client/ayon_core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22
"""Package declaring AYON addon 'core' version."""
3-
__version__ = "1.8.7+dev"
3+
__version__ = "1.8.8+dev"

package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "core"
22
title = "Core"
3-
version = "1.8.7+dev"
3+
version = "1.8.8+dev"
44

55
client_dir = "ayon_core"
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[project]
77
name = "ayon-core"
8-
version = "1.8.7+dev"
8+
version = "1.8.8+dev"
99
description = "AYON core provides the base building blocks for all other AYON addons and integrations and is responsible for discovery and initialization of other addons."
1010
authors = [
1111
{name = "Ynput s.r.o.", email = "info@ynput.io"}

server/settings/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def _convert_burnin_offset_1_8_6(
347347
.get("ExtractBurnin", {})
348348
.get("options")
349349
)
350-
if burnin_options:
350+
if not burnin_options:
351351
return
352352

353353
x_offset = burnin_options.get("x_offset")

0 commit comments

Comments
 (0)