Skip to content

Commit 1625e55

Browse files
author
Gauvain Pocentek
committed
implement project transfer support
1 parent 1e3061c commit 1625e55

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gitlab.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class GitlabProtectError(Exception):
5050
pass
5151

5252

53+
class GitlabTransferProjectError(Exception):
54+
pass
55+
56+
5357
class GitlabAuthenticationError(Exception):
5458
pass
5559

@@ -445,6 +449,13 @@ class Group(GitlabObject):
445449
_url = '/groups'
446450
_constructorTypes = {'projects': 'Project'}
447451

452+
def transfer_project(self, id):
453+
url = '/groups/%d/projects/%d?private_token=%s' % \
454+
(self.id, id, self.gitlab.private_token)
455+
r = self.gitlab.rawPost(url, None)
456+
if r.status_code != 201:
457+
raise GitlabTransferProjectError()
458+
448459

449460
class Hook(GitlabObject):
450461
_url = '/hooks'

0 commit comments

Comments
 (0)