Skip to content

Commit 861024e

Browse files
authored
Merge pull request #44 from eecs485staff/bugfix-empty-assign-type
Fix exception when assignment type is None
2 parents 0ba57d3 + 16adf23 commit 861024e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agiocli/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def parse_project_string(user_input):
290290
if (match.group("asstype") and not match.group("num")
291291
and not match.group("subtitle")):
292292
subtitle = match.group("asstype")
293-
return None, None, subtitle
293+
return "", 0, subtitle
294294

295295
# Convert assignment type abbreviations to canonical "Project", "Lab", etc.
296296
assignment_types = {
@@ -317,6 +317,9 @@ def parse_project_string(user_input):
317317
num = int(match.group("num"))
318318
subtitle = match.group("subtitle")
319319

320+
assert asstype is not None, f"Parse proj type failed: '{user_input}'"
321+
assert num is not None, f"Parse proj num failed: '{user_input}'"
322+
assert subtitle is not None, f"Parse proj subtitle failed: '{user_input}'"
320323
return asstype, num, subtitle
321324

322325

@@ -587,6 +590,7 @@ def get_submission_smart(
587590

588591
# Get a group
589592
group = get_group_smart(group_arg, project_arg, course_arg, client)
593+
590594
# User provides "best"
591595
if submission_arg == "best":
592596
return client.get(f"/api/groups/{group['pk']}/ultimate_submission/")

0 commit comments

Comments
 (0)