diff --git a/AUTHORS.md b/AUTHORS.md index 14b9efd5..e0aab76d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -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) @@ -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) diff --git a/CHANGELOG.md b/CHANGELOG.md index 114c5dda..34caa973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/canvasapi/section.py b/canvasapi/section.py index efee92f5..d76be750 100644 --- a/canvasapi/section.py +++ b/canvasapi/section.py @@ -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. @@ -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): """