Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c8cb29

Browse files
author
Gauvain Pocentek
committed
[v4] Update user (un)block HTTP methods
1 parent41f141d commit5c8cb29

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
defblock(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
defunblock(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)

[8]ページ先頭

©2009-2025 Movatter.jp