Skip to content

Commit 1600770

Browse files
author
Gauvain Pocentek
committed
Implement project contributors
1 parent 250f348 commit 1600770

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gitlab/objects.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,21 @@ def compare(self, from_, to, **kwargs):
15121512
raise_error_from_response(r, GitlabGetError)
15131513
return r.json()
15141514

1515+
def contributors(self):
1516+
"""Returns a list of contributors for the project.
1517+
1518+
Returns:
1519+
list: The contibutors
1520+
1521+
Raises:
1522+
GitlabConnectionError: If the server cannot be reached.
1523+
GitlabGetError: If the server fails to perform the request.
1524+
"""
1525+
url = "/projects/%s/repository/contributors" % self.id
1526+
r = self.gitlab._raw_get(url)
1527+
raise_error_from_response(r, GitlabListError)
1528+
return r.json()
1529+
15151530
def archive(self, sha=None, **kwargs):
15161531
"""Return a tarball of the repository.
15171532

0 commit comments

Comments
 (0)