summaryrefslogtreecommitdiff
path: root/gitlab.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:44:33 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:44:33 +0100
commit1625e55f7afe0080fbc9ddcebdbfb0702e38ded6 (patch)
treeb81b386285d1301fd80343b47be6846d6e1aa327 /gitlab.py
parent1e3061c826a643204cef425758996d01d3b40f74 (diff)
downloadgitlab-1625e55f7afe0080fbc9ddcebdbfb0702e38ded6.tar.gz
implement project transfer support
Diffstat (limited to 'gitlab.py')
-rw-r--r--gitlab.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gitlab.py b/gitlab.py
index 33f5831..e8b6765 100644
--- a/gitlab.py
+++ b/gitlab.py
@@ -50,6 +50,10 @@ class GitlabProtectError(Exception):
pass
+class GitlabTransferProjectError(Exception):
+ pass
+
+
class GitlabAuthenticationError(Exception):
pass
@@ -445,6 +449,13 @@ class Group(GitlabObject):
_url = '/groups'
_constructorTypes = {'projects': 'Project'}
+ def transfer_project(self, id):
+ url = '/groups/%d/projects/%d?private_token=%s' % \
+ (self.id, id, self.gitlab.private_token)
+ r = self.gitlab.rawPost(url, None)
+ if r.status_code != 201:
+ raise GitlabTransferProjectError()
+
class Hook(GitlabObject):
_url = '/hooks'