diff options
author | John L. Villalovos <john@sodarock.com> | 2022-01-13 16:26:42 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-01-13 16:26:42 -0800 |
commit | 75758bf26bca286ec57d5cef2808560c395ff7ec (patch) | |
tree | 3342749ce73ecc1c1375d7399e0e2a066562133f /gitlab/v4/objects/users.py | |
parent | 34110ddf4022340b238ecd964903bf7a6d729e38 (diff) | |
download | gitlab-75758bf26bca286ec57d5cef2808560c395ff7ec.tar.gz |
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.
Diffstat (limited to 'gitlab/v4/objects/users.py')
-rw-r--r-- | gitlab/v4/objects/users.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py index 53376a9..f5b8f6c 100644 --- a/gitlab/v4/objects/users.py +++ b/gitlab/v4/objects/users.py @@ -179,7 +179,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: Whether the user status has been changed """ - path = f"/users/{self.id}/block" + path = f"/users/{self.encoded_id}/block" server_data = self.manager.gitlab.http_post(path, **kwargs) if server_data is True: self._attrs["state"] = "blocked" @@ -200,7 +200,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: The new object data (*not* a RESTObject) """ - path = f"/users/{self.id}/follow" + path = f"/users/{self.encoded_id}/follow" return self.manager.gitlab.http_post(path, **kwargs) @cli.register_custom_action("User") @@ -218,7 +218,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: The new object data (*not* a RESTObject) """ - path = f"/users/{self.id}/unfollow" + path = f"/users/{self.encoded_id}/unfollow" return self.manager.gitlab.http_post(path, **kwargs) @cli.register_custom_action("User") @@ -236,7 +236,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: Whether the user status has been changed """ - path = f"/users/{self.id}/unblock" + path = f"/users/{self.encoded_id}/unblock" server_data = self.manager.gitlab.http_post(path, **kwargs) if server_data is True: self._attrs["state"] = "active" @@ -257,7 +257,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: Whether the user status has been changed """ - path = f"/users/{self.id}/deactivate" + path = f"/users/{self.encoded_id}/deactivate" server_data = self.manager.gitlab.http_post(path, **kwargs) if server_data: self._attrs["state"] = "deactivated" @@ -278,7 +278,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject): Returns: Whether the user status has been changed """ - path = f"/users/{self.id}/activate" + path = f"/users/{self.encoded_id}/activate" server_data = self.manager.gitlab.http_post(path, **kwargs) if server_data: self._attrs["state"] = "active" |