Skip to content

Commit

Permalink
fix: group_members (pycontribs#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 and svermeulen committed Oct 31, 2021
1 parent 088ac96 commit 8f87530
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 8f87530

Please sign in to comment.