Skip to content
Snippets Groups Projects
Commit 8ae20e38 authored by Nimisha Asthagiri's avatar Nimisha Asthagiri
Browse files

Add grades feature check to subsection task handler.

parent f03e2ce6
No related merge requests found
......@@ -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)
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment