summaryrefslogtreecommitdiff
path: root/gitlab/v4
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/v4')
-rw-r--r--gitlab/v4/objects.py8
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):