apps.py 780 Bytes
Newer Older
1 2 3 4 5 6 7
"""
Grades Application Configuration

Signal handlers are connected here.
"""

from django.apps import AppConfig
8 9
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


class GradesConfig(AppConfig):
    """
    Application Configuration for Grades.
    """
    name = u'lms.djangoapps.grades'

    def ready(self):
        """
        Connect handlers to recalculate grades.
        """
        # Can't import models at module level in AppConfigs, and models get
        # included from the signal handlers
        from .signals import handlers  # pylint: disable=unused-variable
25 26 27
        if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
            from .services import GradesService
            set_runtime_service('grades', GradesService())