diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 22:22:42 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 22:22:42 +0200 |
commit | 5c8cb293bca387309b9e40fc6b1a96cc8fbd8dfe (patch) | |
tree | 2d1b2f101acf21007c689fd995c55f7dccdc267d | |
parent | 41f141d84c6b2790e5d28f476fbfe139be77881e (diff) | |
download | gitlab-5c8cb293bca387309b9e40fc6b1a96cc8fbd8dfe.tar.gz |
[v4] Update user (un)block HTTP methods
-rw-r--r-- | gitlab/v4/objects.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 75090e8..aac7a04 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -140,15 +140,15 @@ class User(GitlabObject): def block(self, **kwargs): """Blocks the user.""" url = '/users/%s/block' % self.id - r = self.gitlab._raw_put(url, **kwargs) - raise_error_from_response(r, GitlabBlockError) + r = self.gitlab._raw_post(url, **kwargs) + raise_error_from_response(r, GitlabBlockError, 201) self.state = 'blocked' def unblock(self, **kwargs): """Unblocks the user.""" url = '/users/%s/unblock' % self.id - r = self.gitlab._raw_put(url, **kwargs) - raise_error_from_response(r, GitlabUnblockError) + r = self.gitlab._raw_post(url, **kwargs) + raise_error_from_response(r, GitlabUnblockError, 201) self.state = 'active' def __eq__(self, other): |