Skip to content

Commit e17fc8d

Browse files
authored
Merge pull request #105 from oslokommune/fix-update-team-attribute
Fix bug in `update_team_attribute`
2 parents fc992fe + 9dc07b1 commit e17fc8d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## ?.?.?
2+
3+
* Fixed a bug in `TeamClient.update_team_attribute` when `value` is falsy.
4+
15
## 2.2.0
26

37
* New parameter `include` added to `TeamClient.get_teams`.

okdata/sdk/team/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ def update_team_attribute(self, team_id, attribute, value):
6464
"""
6565
url = "{}/teams/{}".format(self.api_url, quote(team_id))
6666
log.info(f"SDK:Updating team attribute on: {url}")
67-
return self.patch(url, {"attributes": {attribute: [value]}}).json()
67+
return self.patch(
68+
url, {"attributes": {attribute: [value] if value else []}}
69+
).json()

0 commit comments

Comments
 (0)