Skip to content

Commit 34110dd

Browse files
authored
Merge pull request #1835 from python-gitlab/jlvillal/id_to_encodedid
chore(objects): use `self.encoded_id` where could be a string
2 parents 0788fe6 + c3c3a91 commit 34110dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gitlab/v4/objects/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def transfer_project(self, project_id: int, **kwargs: Any) -> None:
9292
GitlabAuthenticationError: If authentication is not correct
9393
GitlabTransferProjectError: If the project could not be transferred
9494
"""
95-
path = f"/groups/{self.id}/projects/{project_id}"
95+
path = f"/groups/{self.encoded_id}/projects/{project_id}"
9696
self.manager.gitlab.http_post(path, **kwargs)
9797

9898
@cli.register_custom_action("Group", ("scope", "search"))

gitlab/v4/objects/projects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def upload(
442442
with open(filepath, "rb") as f:
443443
filedata = f.read()
444444

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

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

0 commit comments

Comments
 (0)