Merge pull request #19322 from edx/schen/null_assignment_types

Bugfix: Handle the case where assignment type is not in default_labeler
This commit is contained in:
Simon Chen
2018-11-27 14:36:40 -05:00
committed by GitHub

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