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

Appearance settings

Commit 75758bf

Browse filesBrowse files
chore(objects): use self.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 parent 34110dd commit 75758bf
Copy full SHA for 75758bf

File tree

Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎gitlab/v4/objects/todos.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/todos.py
+1-1Lines 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
if TYPE_CHECKING:
3333
assert isinstance(server_data, dict)
Collapse file

‎gitlab/v4/objects/users.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/users.py
+6-6Lines 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
if server_data is True:
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
return self.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
return self.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
if server_data is True:
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
if server_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
if server_data:
284284
self._attrs["state"] = "active"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.