Skip to content

Commit 5c8cb29

Browse files
author
Gauvain Pocentek
committed
[v4] Update user (un)block HTTP methods
1 parent 41f141d commit 5c8cb29

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitlab/v4/objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ def _data_for_gitlab(self, extra_parameters={}, update=False,
140140
def block(self, **kwargs):
141141
"""Blocks the user."""
142142
url = '/users/%s/block' % self.id
143-
r = self.gitlab._raw_put(url, **kwargs)
144-
raise_error_from_response(r, GitlabBlockError)
143+
r = self.gitlab._raw_post(url, **kwargs)
144+
raise_error_from_response(r, GitlabBlockError, 201)
145145
self.state = 'blocked'
146146

147147
def unblock(self, **kwargs):
148148
"""Unblocks the user."""
149149
url = '/users/%s/unblock' % self.id
150-
r = self.gitlab._raw_put(url, **kwargs)
151-
raise_error_from_response(r, GitlabUnblockError)
150+
r = self.gitlab._raw_post(url, **kwargs)
151+
raise_error_from_response(r, GitlabUnblockError, 201)
152152
self.state = 'active'
153153

154154
def __eq__(self, other):

0 commit comments

Comments
 (0)