summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'