From d778b0634bbc6500cc75b322ef5831d2c7fb7e39 Mon Sep 17 00:00:00 2001 From: Ivo Bellin Salarin Date: Mon, 27 Apr 2020 16:59:44 +0200 Subject: [PATCH 1/2] fix: group_members Some attributes have become obsolete with the latest GDPR developments. Avoid client crashes trying to retrieve the members of a group. --- jira/client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jira/client.py b/jira/client.py index 8e0f30d63..746fc06df 100644 --- a/jira/client.py +++ b/jira/client.py @@ -1211,11 +1211,14 @@ def group_members(self, group): result = {} for user in r["users"]["items"]: - result[user["key"]] = { - "name": user["name"], - "fullname": user["displayName"], - "email": user.get("emailAddress", "hidden"), - "active": user["active"], + 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.get('active'), + 'timezone': user.get('timezone') } return OrderedDict(sorted(result.items(), key=lambda t: t[0])) From 2f18768f5bdd8be953484a39bb15f82001481bd8 Mon Sep 17 00:00:00 2001 From: Ivo Bellin Salarin Date: Tue, 11 May 2021 21:54:33 +0200 Subject: [PATCH 2/2] chore: blacken --- jira/client.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jira/client.py b/jira/client.py index 746fc06df..4adbedbe0 100644 --- a/jira/client.py +++ b/jira/client.py @@ -1211,14 +1211,14 @@ def group_members(self, group): result = {} for user in r["users"]["items"]: - 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.get('active'), - 'timezone': user.get('timezone') + 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.get("active"), + "timezone": user.get("timezone"), } return OrderedDict(sorted(result.items(), key=lambda t: t[0]))