Skip to content
Snippets Groups Projects
Commit 558ce331 authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Fixed bugs when grading team contributions without common project prefix

- Handles bad entry of path
- Handles project team with no students
parent 4b0ed65a
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ from datetime import date
from math import ceil, log10
from typing import Tuple
from gitlab import GitlabError
from api.canvas_classes import *
from api.gitlab_classes import *
from common_functions import select_from_list, strip_html
......@@ -176,8 +178,19 @@ if __name__ == '__main__':
print()
if grading_git_histories:
if no_common_prefix:
custom_project = input(f'Enter path to {student_group.get_name()}\'s repository: ')
display_git_contributions(GitlabProject(custom_project))
custom_project: str = None
repository: GitlabProject = None
while custom_project is None:
custom_project = input(
f'Enter path to {student_group.get_name()}\'s repository (leave blank to skip): ')
try:
if len(custom_project) > 0:
repository = GitlabProject(custom_project)
except GitlabError:
print(f'Could not location repository {custom_project}; please confirm path.')
custom_project = None
if len(custom_project) > 0:
display_git_contributions(repository)
else:
project_name = f'{project_prefix}{student_group.get_name().split()[1]}'.zfill(zero_padding)
display_git_contributions(list(filter(lambda p: p.get_name() == project_name, projects))[0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment