X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitlab/v4/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(

self.mgr_cls._path = self.mgr_cls._path.format(**self.parent_args)
self.mgr = self.mgr_cls(gl)

self.mgr._from_parent_attrs = self.parent_args
if self.mgr_cls._types:
for attr_name, type_cls in self.mgr_cls._types.items():
if attr_name in self.args.keys():
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def list(self, **kwargs: Any) -> Union[RESTObjectList, List[RESTObject]]:
if self._parent:
path = f"/users/{self._parent.id}/projects"
else:
path = f"/users/{kwargs['user_id']}/projects"
path = f"/users/{self._from_parent_attrs['user_id']}/projects"
return ListMixin.list(self, path=path, **kwargs)


Expand Down
7 changes: 7 additions & 0 deletions tests/functional/cli/test_cli_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ def test_create_user_impersonation_token_with_scopes(gitlab_cli, user):
ret = gitlab_cli(cmd)

assert ret.success


def test_list_user_projects(gitlab_cli, user):
cmd = ["user-project", "list", "--user-id", user.id]
ret = gitlab_cli(cmd)

assert ret.success
X Tutup