Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Henrik Skov Midtiby
gitlab-assignment-handler
Commits
de5fc6e5
Commit
de5fc6e5
authored
Dec 12, 2019
by
Henrik Skov Midtiby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates .
parent
10dc142d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
create_repository.py
create_repository.py
+28
-0
No files found.
create_repository.py
View file @
de5fc6e5
...
...
@@ -44,6 +44,7 @@ def create_a_new_repository_in_group(repo_name, group_id):
def
add_user_to_project
(
project_id
,
user_id
):
"""
Add user with id "user_id" to the project with id "project_id".
Give developer access rights to the added user.
"""
return
requests
.
post
(
gitlab_url_api4
(
'/projects/%d/members?user_id=%d&access_level=30'
%
...
...
@@ -144,6 +145,33 @@ def create_a_new_repository_in_group_example_two():
pprint
.
pprint
(
resp
.
json
())
# Todos
# * Look up username to get the userid of the user (henrikmidtiby@gmail.com, # 646)
# * Look up class name to get the groupid of the class (SDU UAS Center, # 453)
# * Create a group for a new class
# * Load list of assignments / projects and create repositories for these
# within a specified class.
# * Load list of students and assignments, and add students to the specific
# assignments (within a class).
# * Load list of assignments, download / clone all repositories to this
# computer.
# List of assignments
assignment_name
class
hw1
-
adam
test2
hw1
-
birger
test2
hw2
-
adam
test2
hw2
-
birger
test2
# List of students to add to a project
student_id
assignment_name
class
101
hw1
-
birger
test2
105
hw1
-
adam
test2
105
hw2
-
adam
test2
# fetch_and_show_commits_example()
# create_a_new_repository_example()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment