From 1600770e1d01aaaa90dbfd602e073e4e4a578fc1 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sun, 8 May 2016 12:43:11 +0200 Subject: [PATCH] Implement project contributors --- gitlab/objects.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gitlab/objects.py b/gitlab/objects.py index 3a44f6ebd..9594c2bf7 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1512,6 +1512,21 @@ def compare(self, from_, to, **kwargs): raise_error_from_response(r, GitlabGetError) return r.json() + def contributors(self): + """Returns a list of contributors for the project. + + Returns: + list: The contibutors + + Raises: + GitlabConnectionError: If the server cannot be reached. + GitlabGetError: If the server fails to perform the request. + """ + url = "/projects/%s/repository/contributors" % self.id + r = self.gitlab._raw_get(url) + raise_error_from_response(r, GitlabListError) + return r.json() + def archive(self, sha=None, **kwargs): """Return a tarball of the repository.