diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index fd673b522..92610fe47 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -236,8 +236,11 @@ def list(self, **kwargs): GitlabAuthenticationError: If authentication is not correct GitlabListError: If the server cannot perform the request """ + if self._parent is not None: + path = '/users/%s/projects' % self._parent.id + else: + path = '/users/%s/projects' % kwargs['user_id'] - path = '/users/%s/projects' % self._parent.id return ListMixin.list(self, path=path, **kwargs)