From 5c8cb293bca387309b9e40fc6b1a96cc8fbd8dfe Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Tue, 23 May 2017 22:22:42 +0200 Subject: [v4] Update user (un)block HTTP methods --- gitlab/v4/objects.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gitlab') 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): -- cgit v1.2.1