summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2022-01-14 01:21:46 +0100
committerGitHub <noreply@github.com>2022-01-14 01:21:46 +0100
commit34110ddf4022340b238ecd964903bf7a6d729e38 (patch)
tree7ea1f02f20e6d35bd321c76016d830085db1b232
parent0788fe677128d8c25db1cc107fef860a5a3c2a42 (diff)
parentc3c3a914fa2787ae6a1368fe6550585ee252c901 (diff)
downloadgitlab-34110ddf4022340b238ecd964903bf7a6d729e38.tar.gz
Merge pull request #1835 from python-gitlab/jlvillal/id_to_encodedid
chore(objects): use `self.encoded_id` where could be a string
-rw-r--r--gitlab/v4/objects/groups.py2
-rw-r--r--gitlab/v4/objects/projects.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 453548b..662ea5d 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -92,7 +92,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
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"))
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py
index 1a765d1..f9988db 100644
--- a/gitlab/v4/objects/projects.py
+++ b/gitlab/v4/objects/projects.py
@@ -442,7 +442,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO
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)
@@ -539,7 +539,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO
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
)