Merge pull request #13887 from edx/hotfix2/2016-11-01

Add grades feature check to subsection task handler.
This commit is contained in:
Nimisha Asthagiri
2016-11-02 08:23:54 -04:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -32,8 +32,10 @@ def recalculate_subsection_grade(user_id, course_id, usage_id, only_if_higher):
be updated only if the new grade is higher than the previous
value.
"""
course_key = CourseLocator.from_string(course_id)
if not PersistentGradesEnabledFlag.feature_enabled(course_id):
return
course_key = CourseLocator.from_string(course_id)
student = User.objects.get(id=user_id)
scored_block_usage_key = UsageKey.from_string(usage_id).replace(course_key=course_key)

View File

@@ -178,7 +178,7 @@ class RecalculateSubsectionGradeTest(ModuleStoreTestCase):
with self.store.default_store(default_store):
self.set_up_course(enable_subsection_grades=False)
self.assertFalse(PersistentGradesEnabledFlag.feature_enabled(self.course.id))
with check_mongo_calls(2) and self.assertNumQueries(2):
with check_mongo_calls(2) and self.assertNumQueries(0):
recalculate_subsection_grade.apply(args=tuple(self.score_changed_kwargs.values()))
@skip("Pending completion of TNL-5089")