8000 Merge pull request #886 from LuckySB/cli_user_project · python-gitlab/python-gitlab@88b1833 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88b1833

Browse files
authored
Merge pull request #886 from LuckySB/cli_user_project
fix cli command user-project list
2 parents ff10726 + c17d7ce commit 88b1833

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitlab/v4/objects.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ def list(self, **kwargs):
278278
GitlabAuthenticationError: If authentication is not correct
279279
GitlabListError: If the server cannot perform the request
280280
"""
281-
282-
path = "/users/%s/projects" % self._parent.id
281+
if self._parent:
282+
path = "/users/%s/projects" % self._parent.id
283+
else:
284+
path = "/users/%s/projects" % kwargs["user_id"]
283285
return ListMixin.list(self, path=path, **kwargs)
284286

285287

0 commit comments

Comments
 (0)
0