Skip to content

Commit

Permalink
Merge pull request #1835 from python-gitlab/jlvillal/id_to_encodedid
Browse files Browse the repository at this point in the history
chore(objects): use `self.encoded_id` where could be a string
  • Loading branch information
nejch committed Jan 14, 2022
2 parents 0788fe6 + c3c3a91 commit 34110dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gitlab/v4/objects/groups.py
Expand Up @@ -92,7 +92,7 @@ def transfer_project(self, project_id: int, **kwargs: Any) -> None:
GitlabAuthenticationError: If authentication is not correct
GitlabTransferProjectError: If the project could not be transferred
"""
path = f"/groups/{self.id}/projects/{project_id}"
path = f"/groups/{self.encoded_id}/projects/{project_id}"
self.manager.gitlab.http_post(path, **kwargs)

@cli.register_custom_action("Group", ("scope", "search"))
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/projects.py
Expand Up @@ -442,7 +442,7 @@ def upload(
with open(filepath, "rb") as f:
filedata = f.read()

url = f"/projects/{self.id}/uploads"
url = f"/projects/{self.encoded_id}/uploads"
file_info = {"file": (filename, filedata)}
data = self.manager.gitlab.http_post(url, files=file_info)

Expand Down Expand Up @@ -539,7 +539,7 @@ def transfer(self, to_namespace: Union[int, str], **kwargs: Any) -> None:
GitlabAuthenticationError: If authentication is not correct
GitlabTransferProjectError: If the project could not be transferred
"""
path = f"/projects/{self.id}/transfer"
path = f"/projects/{self.encoded_id}/transfer"
self.manager.gitlab.http_put(
path, post_data={"namespace": to_namespace}, **kwargs
)
Expand Down

0 comments on commit 34110dd

Please sign in to comment.