Skip to content

Commit

Permalink
fix: group_members (#933)
Browse files Browse the repository at this point in the history
* fix: group_members

Some attributes have become obsolete with the latest GDPR developments.
Avoid client crashes trying to retrieve the members of a group.

* chore: blacken
  • Loading branch information
nilleb authored May 15, 2021
1 parent ca9f178 commit 0c3e424
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,11 +1216,14 @@ def group_members(self, group: str) -> OrderedDict:

result = {}
for user in r["users"]["items"]:
result[user["key"]] = {
"name": user["name"],
"fullname": user["displayName"],
result[user["id"]] = {
"name": user.get("name"),
"id": user.get("id"),
"accountId": user.get("accountId"),
"fullname": user.get("displayName"),
"email": user.get("emailAddress", "hidden"),
"active": user["active"],
"active": user.get("active"),
"timezone": user.get("timezone"),
}
return OrderedDict(sorted(result.items(), key=lambda t: t[0]))

Expand Down

0 comments on commit 0c3e424

Please sign in to comment.