summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/users.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-01 19:22:18 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-11-02 07:03:33 +0100
commit30fa865cfe145d172b7061cb2af03837b3d1d312 (patch)
tree414f0a060d4dce56310327e07cbdcf7f41f39fc3 /gitlab/v4/objects/users.py
parentc7fdad42f68927d79e0d1963ade3324370b9d0e2 (diff)
downloadgitlab-refactor/f-strings.tar.gz
refactor: use f-strings for string formattingrefactor/f-strings
Diffstat (limited to 'gitlab/v4/objects/users.py')
-rw-r--r--gitlab/v4/objects/users.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py
index 4f8721a..f8cbe16 100644
--- a/gitlab/v4/objects/users.py
+++ b/gitlab/v4/objects/users.py
@@ -154,7 +154,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
bool: Whether the user status has been changed
"""
- path = "/users/%s/block" % self.id
+ path = f"/users/{self.id}/block"
server_data = self.manager.gitlab.http_post(path, **kwargs)
if server_data is True:
self._attrs["state"] = "blocked"
@@ -175,7 +175,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
dict: The new object data (*not* a RESTObject)
"""
- path = "/users/%s/follow" % self.id
+ path = f"/users/{self.id}/follow"
return self.manager.gitlab.http_post(path, **kwargs)
@cli.register_custom_action("User")
@@ -193,7 +193,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
dict: The new object data (*not* a RESTObject)
"""
- path = "/users/%s/unfollow" % self.id
+ path = f"/users/{self.id}/unfollow"
return self.manager.gitlab.http_post(path, **kwargs)
@cli.register_custom_action("User")
@@ -211,7 +211,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
bool: Whether the user status has been changed
"""
- path = "/users/%s/unblock" % self.id
+ path = f"/users/{self.id}/unblock"
server_data = self.manager.gitlab.http_post(path, **kwargs)
if server_data is True:
self._attrs["state"] = "active"
@@ -232,7 +232,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
bool: Whether the user status has been changed
"""
- path = "/users/%s/deactivate" % self.id
+ path = f"/users/{self.id}/deactivate"
server_data = self.manager.gitlab.http_post(path, **kwargs)
if server_data:
self._attrs["state"] = "deactivated"
@@ -253,7 +253,7 @@ class User(SaveMixin, ObjectDeleteMixin, RESTObject):
Returns:
bool: Whether the user status has been changed
"""
- path = "/users/%s/activate" % self.id
+ path = f"/users/{self.id}/activate"
server_data = self.manager.gitlab.http_post(path, **kwargs)
if server_data:
self._attrs["state"] = "active"
@@ -504,9 +504,9 @@ class UserProjectManager(ListMixin, CreateMixin, RESTManager):
GitlabListError: If the server cannot perform the request
"""
if self._parent:
- path = "/users/%s/projects" % self._parent.id
+ path = f"/users/{self._parent.id}/projects"
else:
- path = "/users/%s/projects" % kwargs["user_id"]
+ path = f"/users/{kwargs['user_id']}/projects"
return ListMixin.list(self, path=path, **kwargs)