Handle the case where assignment type is not in default_labeler

This commit is contained in:
Simon Chen
2018-11-27 12:53:28 -05:00
parent 44101d656d
commit 8941f8afbf

View File

@@ -90,6 +90,8 @@ def get_default_short_labeler(course):
for that assignment type, this function would return "Ex 02", assuming
that "Ex" is the short_label assigned to a grader for Homework subsections.
"""
if assignment_type not in default_labelers:
return None
labeler = default_labelers[assignment_type]['labeler']
index = default_labelers[assignment_type]['index']
default_labelers[assignment_type]['index'] += 1