Cons up new dict to not hurt cached value

This commit is contained in:
Don Mitchell
2014-10-06 16:51:07 -04:00
committed by Calen Pennington
parent 41d4b1286f
commit eb33f0e0eb

View File

@@ -205,10 +205,11 @@ class CourseGradingModel(object):
@staticmethod
def jsonize_grader(i, grader):
grader['id'] = i
if grader['weight']:
grader['weight'] *= 100
if not 'short_label' in grader:
grader['short_label'] = ""
return grader
return {
"id": i,
"type": grader["type"],
"min_count": grader.get('min_count', 0),
"drop_count": grader.get('drop_count', 0),
"short_label": grader.get('short_label', ""),
"weight": grader.get('weight', 0) * 100,
}