Skip to content
Snippets Groups Projects
Commit de358648 authored by Harrison Cook's avatar Harrison Cook
Browse files

transfer project to group

parent b48050fa
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
import requests as r
import json as j
SECRET_KEY = 'SWZskgnDTNUzVsQ7EmKs'
SECRET_KEY = '' # FILL IN
BASE_URL = 'https://gitlab.cs.umd.edu/'
DEFAULT_HEADERS = {
......@@ -68,3 +68,18 @@ def add_to_project(project_id, user_id, permission):
except KeyError:
return False
def transfer_to_group(project_id, group_id):
rq = r.put (
BASE_URL + "api/v4/projects/" + str(project_id) + "/transfer",
headers = DEFAULT_HEADERS,
data = j.dumps(
{
'namespace' : group_id
}
)
)
res = j.loads(rq.text)
try:
return res['id'] == project_id
except KeyError:
return False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment