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

Commit75758bf

Browse files
chore(objects): useself.encoded_id where applicable
Updated a few remaining usages of `self.id` to use `self.encoded_id`as for the most part we shouldn't be using `self.id`There are now only a few (4 lines of code) remaining uses of`self.id`, most of which seem that they should stay that way.
1 parent34110dd commit75758bf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎gitlab/v4/objects/todos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def mark_as_done(self, **kwargs: Any) -> Dict[str, Any]:
2727
Returns:
2828
A dict with the result
2929
"""
30-
path=f"{self.manager.path}/{self.id}/mark_as_done"
30+
path=f"{self.manager.path}/{self.encoded_id}/mark_as_done"
3131
server_data=self.manager.gitlab.http_post(path,**kwargs)
3232
ifTYPE_CHECKING:
3333
assertisinstance(server_data,dict)

‎gitlab/v4/objects/users.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def block(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
179179
Returns:
180180
Whether the user status has been changed
181181
"""
182-
path=f"/users/{self.id}/block"
182+
path=f"/users/{self.encoded_id}/block"
183183
server_data=self.manager.gitlab.http_post(path,**kwargs)
184184
ifserver_dataisTrue:
185185
self._attrs["state"]="blocked"
@@ -200,7 +200,7 @@ def follow(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
200200
Returns:
201201
The new object data (*not* a RESTObject)
202202
"""
203-
path=f"/users/{self.id}/follow"
203+
path=f"/users/{self.encoded_id}/follow"
204204
returnself.manager.gitlab.http_post(path,**kwargs)
205205

206206
@cli.register_custom_action("User")
@@ -218,7 +218,7 @@ def unfollow(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
218218
Returns:
219219
The new object data (*not* a RESTObject)
220220
"""
221-
path=f"/users/{self.id}/unfollow"
221+
path=f"/users/{self.encoded_id}/unfollow"
222222
returnself.manager.gitlab.http_post(path,**kwargs)
223223

224224
@cli.register_custom_action("User")
@@ -236,7 +236,7 @@ def unblock(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
236236
Returns:
237237
Whether the user status has been changed
238238
"""
239-
path=f"/users/{self.id}/unblock"
239+
path=f"/users/{self.encoded_id}/unblock"
240240
server_data=self.manager.gitlab.http_post(path,**kwargs)
241241
ifserver_dataisTrue:
242242
self._attrs["state"]="active"
@@ -257,7 +257,7 @@ def deactivate(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
257257
Returns:
258258
Whether the user status has been changed
259259
"""
260-
path=f"/users/{self.id}/deactivate"
260+
path=f"/users/{self.encoded_id}/deactivate"
261261
server_data=self.manager.gitlab.http_post(path,**kwargs)
262262
ifserver_data:
263263
self._attrs["state"]="deactivated"
@@ -278,7 +278,7 @@ def activate(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
278278
Returns:
279279
Whether the user status has been changed
280280
"""
281-
path=f"/users/{self.id}/activate"
281+
path=f"/users/{self.encoded_id}/activate"
282282
server_data=self.manager.gitlab.http_post(path,**kwargs)
283283
ifserver_data:
284284
self._attrs["state"]="active"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp