Skip to content

Commit

Permalink
Merge pull request #220 from wjw27/develop
Browse files Browse the repository at this point in the history
add kwargs to section.edit() #219
  • Loading branch information
Thetwam committed Dec 4, 2018
2 parents 98e7f06 + d23f3e4 commit 70f66de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
Expand Up @@ -15,6 +15,7 @@ Patches and Suggestions
- Andrew Gardener [@andrew-gardener](https://github.com/andrew-gardener)
- Anthony Rodriguez [@AnthonyRodriguez726](https://github.com/AnthonyRodriguez726)
- Ben Liblit [@liblit](https://github.com/liblit)
- Bill Wrbican [@wjw27](https://github.com/wjw27)
- Daniel Brinkman [@DanBrink91](https://github.com/DanBrink91)
- Daniel Grobani [@dgrobani](https://github.com/dgrobani)
- David Warden [@dfwarden](https://github.com/dfwarden)
Expand All @@ -39,5 +40,6 @@ Patches and Suggestions
- Stephen Woosley [@stephenwoosley](https://github.com/stephenwoosley)
- [@Tobiaqs](https://github.com/Tobiaqs)
- Tuan Pham [@tuanvpham](https://github.com/tuanvpham)
- Tyler Wallace [@wallacetyler](https://github.com/wallacetyler)
- William Funk [@WilliamRADFunk](https://github.com/WilliamRADFunk)
- William Wesley Monroe [@purpleHey](https://github.com/purpleHey)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,10 @@

- Added support for HTTP response 409 (Thanks, [@wallacetyler](https://github.com/wallacetyler))

### Bugfixes

- Fixed an issue where `Section.edit()` didn't accept keyword arguments (Thanks, [@wjw27](https://github.com/wjw27))

## [0.11.0] - 2018-09-17

### New Endpoint Coverage
Expand Down
11 changes: 8 additions & 3 deletions canvasapi/section.py
Expand Up @@ -104,7 +104,7 @@ def decross_list_section(self):
)
return Section(self._requester, response.json())

def edit(self):
def edit(self, **kwargs):
"""
Edit contents of a target section.
Expand All @@ -115,9 +115,14 @@ def edit(self):
"""
response = self._requester.request(
'PUT',
'sections/{}'.format(self.id)
'sections/{}'.format(self.id),
_kwargs=combine_kwargs(**kwargs)
)
return Section(self._requester, response.json())

if 'name' in response.json():
super(Section, self).set_attributes(response.json())

return self

def delete(self):
"""
Expand Down

0 comments on commit 70f66de

Please sign in to comment.