diff --git a/devilry/devilry_admin/views/assignment/gradingconfiguration.py b/devilry/devilry_admin/views/assignment/gradingconfiguration.py index 6d3b7aa93..b74f83f13 100644 --- a/devilry/devilry_admin/views/assignment/gradingconfiguration.py +++ b/devilry/devilry_admin/views/assignment/gradingconfiguration.py @@ -183,10 +183,16 @@ def __create_point_to_grade_map(self, form, assignment): def form_valid(self, form): assignment = self.request.cradmin_role - assignment.grading_system_plugin_id = form.cleaned_data['grading_system_plugin_id'] - assignment.points_to_grade_mapper = form.cleaned_data['points_to_grade_mapper'] - assignment.passing_grade_min_points = form.cleaned_data['passing_grade_min_points'] - assignment.max_points = form.cleaned_data['max_points'] + grading_system_plugin_id = form.cleaned_data['grading_system_plugin_id'] + points_to_grade_mapper = form.cleaned_data['points_to_grade_mapper'] + passing_grade_min_points = form.cleaned_data['passing_grade_min_points'] + max_points = form.cleaned_data['max_points'] + assignment.setup_grading( + grading_system_plugin_id, + points_to_grade_mapper, + passing_grade_min_points, + max_points + ) assignment.full_clean() with transaction.atomic(): assignment.save()