Commit 08e04dbd by Tyler Hallada

Fix circular import of signals from services

parent 10ed05ee
...@@ -8,7 +8,6 @@ from util.date_utils import to_timestamp ...@@ -8,7 +8,6 @@ from util.date_utils import to_timestamp
from .constants import ScoreDatabaseTableEnum from .constants import ScoreDatabaseTableEnum
from .models import PersistentSubsectionGrade, PersistentSubsectionGradeOverride from .models import PersistentSubsectionGrade, PersistentSubsectionGradeOverride
from .signals.handlers import SUBSECTION_RESCORE_EVENT_TYPE
def _get_key(key_or_id, key_cls): def _get_key(key_or_id, key_cls):
...@@ -69,7 +68,9 @@ class GradesService(object): ...@@ -69,7 +68,9 @@ class GradesService(object):
Fires off a recalculate_subsection_grade async task to update the PersistentSubsectionGrade table. Will not Fires off a recalculate_subsection_grade async task to update the PersistentSubsectionGrade table. Will not
override earned_all or earned_graded value if they are None. Both default to None. override earned_all or earned_graded value if they are None. Both default to None.
""" """
from .tasks import recalculate_subsection_grade_v3 # prevent circular import # prevent circular imports:
from .signals.handlers import SUBSECTION_RESCORE_EVENT_TYPE
from .tasks import recalculate_subsection_grade_v3
course_key = _get_key(course_key_or_id, CourseKey) course_key = _get_key(course_key_or_id, CourseKey)
usage_key = _get_key(usage_key_or_id, UsageKey) usage_key = _get_key(usage_key_or_id, UsageKey)
...@@ -111,7 +112,9 @@ class GradesService(object): ...@@ -111,7 +112,9 @@ class GradesService(object):
Fires off a recalculate_subsection_grade async task to update the PersistentSubsectionGrade table. If the Fires off a recalculate_subsection_grade async task to update the PersistentSubsectionGrade table. If the
override does not exist, no error is raised, it just triggers the recalculation. override does not exist, no error is raised, it just triggers the recalculation.
""" """
from .tasks import recalculate_subsection_grade_v3 # prevent circular import # prevent circular imports:
from .signals.handlers import SUBSECTION_RESCORE_EVENT_TYPE
from .tasks import recalculate_subsection_grade_v3
course_key = _get_key(course_key_or_id, CourseKey) course_key = _get_key(course_key_or_id, CourseKey)
usage_key = _get_key(usage_key_or_id, UsageKey) usage_key = _get_key(usage_key_or_id, UsageKey)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment