diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-01 19:22:18 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-02 07:03:33 +0100 |
commit | 30fa865cfe145d172b7061cb2af03837b3d1d312 (patch) | |
tree | 414f0a060d4dce56310327e07cbdcf7f41f39fc3 /gitlab/v4/objects/groups.py | |
parent | c7fdad42f68927d79e0d1963ade3324370b9d0e2 (diff) | |
download | gitlab-refactor/f-strings.tar.gz |
refactor: use f-strings for string formattingrefactor/f-strings
Diffstat (limited to 'gitlab/v4/objects/groups.py')
-rw-r--r-- | gitlab/v4/objects/groups.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index b675a39..6b390b1 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -85,7 +85,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabTransferProjectError: If the project could not be transferred """ - path = "/groups/%s/projects/%s" % (self.id, project_id) + path = f"/groups/{self.id}/projects/{project_id}" self.manager.gitlab.http_post(path, **kwargs) @cli.register_custom_action("Group", ("scope", "search")) @@ -106,7 +106,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabList: A list of dicts describing the resources found. """ data = {"scope": scope, "search": search} - path = "/groups/%s/search" % self.get_id() + path = f"/groups/{self.get_id()}/search" return self.manager.gitlab.http_list(path, query_data=data, **kwargs) @cli.register_custom_action("Group", ("cn", "group_access", "provider")) @@ -125,7 +125,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server cannot perform the request """ - path = "/groups/%s/ldap_group_links" % self.get_id() + path = f"/groups/{self.get_id()}/ldap_group_links" data = {"cn": cn, "group_access": group_access, "provider": provider} self.manager.gitlab.http_post(path, post_data=data, **kwargs) @@ -143,10 +143,10 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request """ - path = "/groups/%s/ldap_group_links" % self.get_id() + path = f"/groups/{self.get_id()}/ldap_group_links" if provider is not None: - path += "/%s" % provider - path += "/%s" % cn + path += f"/{provider}" + path += f"/{cn}" self.manager.gitlab.http_delete(path) @cli.register_custom_action("Group") @@ -161,7 +161,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server cannot perform the request """ - path = "/groups/%s/ldap_sync" % self.get_id() + path = f"/groups/{self.get_id()}/ldap_sync" self.manager.gitlab.http_post(path, **kwargs) @cli.register_custom_action("Group", ("group_id", "group_access"), ("expires_at",)) @@ -178,7 +178,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server failed to perform the request """ - path = "/groups/%s/share" % self.get_id() + path = f"/groups/{self.get_id()}/share" data = { "group_id": group_id, "group_access": group_access, @@ -199,7 +199,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the request """ - path = "/groups/%s/share/%s" % (self.get_id(), group_id) + path = f"/groups/{self.get_id()}/share/{group_id}" self.manager.gitlab.http_delete(path, **kwargs) |