diff --git a/denis/peer_review.py b/denis/peer_review.py index a9ca53d2..ac2f3bd3 100755 --- a/denis/peer_review.py +++ b/denis/peer_review.py @@ -18,6 +18,7 @@ tags1 = utilities.update_tags(assignment, 'review1') tags2 = utilities.update_tags(assignment, 'review2') -utilities.run_automated_checks(tags1 + tags2, usernames_to_subs_review1 | usernames_to_subs_review2, peer=True) +utilities.run_automated_checks(tags1, usernames_to_subs_review1, peer=True) +utilities.run_automated_checks(tags2, usernames_to_subs_review2, peer=True) print(f'completed {assignment} assignment processing for peer review submission deadline') diff --git a/denis/utilities.py b/denis/utilities.py index 59ef108e..35efdea2 100644 --- a/denis/utilities.py +++ b/denis/utilities.py @@ -174,9 +174,11 @@ def check_subject_tag(repo, tag): def run_automated_checks(tags, username_to_subs, peer=False): with tempfile.TemporaryDirectory() as repo_path: repo = git.Repo.clone_from(PULL_URL, repo_path) + # fetch from the pull URL: the CGI server behind the push URL drops + # the Content-Encoding header, so a gzipped fetch request fails there + repo.remotes.origin.fetch('refs/notes/*:refs/notes/*') remote = repo.create_remote(REMOTE_NAME, PUSH_URL) - remote.fetch('refs/notes/*:refs/notes/*') configure_repo(repo) for tag in tags: diff --git a/orbit/hyperspace.py b/orbit/hyperspace.py index dcdb6ec4..67ce5a0c 100755 --- a/orbit/hyperspace.py +++ b/orbit/hyperspace.py @@ -16,12 +16,14 @@ def errx(msg): exit(1) -def need(a, u=False, p=False): +def need(a, u=False, p=False, f=False): needed = [] if u and a.username is None: needed.append('username') if p and a.password is None: needed.append('password') + if f and a.fullname is None: + needed.append('fullname') if needed: errx(f"Need {' and '.join(needed)}. Bye.") @@ -50,6 +52,15 @@ def do_change_password(args): nou(args.username) +def do_change_fullname(args): + need(args, u=True, f=True) + query = (db.User + .update({db.User.fullname: args.fullname}) + .where(db.User.username == args.username)) + if query.execute() < 1: + nou(args.username) + + def do_reset_password(args): need(args, u=True) query = (db.User @@ -89,7 +100,7 @@ def do_newuser(args): def do_roster(args): print('Users:') for u in db.User.select(): - print(f'{u.username}, {u.pwdhash}, {u.student_id}') + print(f'{u.username}, {u.pwdhash}, {u.student_id}, {u.fullname}') def do_list_sessions(args): @@ -119,6 +130,9 @@ def hyperspace_main(raw_args): actions.add_argument('-m', '--mutatepassword', action='store_const', help='Change password for supplied username to supplied password', dest='do', const=do_change_password) + actions.add_argument('-e', '--editfullname', action='store_const', + help='Change full name for supplied username to supplied full name', + dest='do', const=do_change_fullname) actions.add_argument('-c', '--clearpassword', action='store_const', help='clear password for supplied username so they cannot login', dest='do', const=do_reset_password)