Commit 2de2e302 by Jeremy Bowman

PLAT-1773 Delegate edx-proctoring service registration to app ready methods

parent b57f1447
...@@ -1028,7 +1028,7 @@ INSTALLED_APPS = [ ...@@ -1028,7 +1028,7 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig', 'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig',
# Credit courses # Credit courses
'openedx.core.djangoapps.credit', 'openedx.core.djangoapps.credit.apps.CreditConfig',
'xblock_django', 'xblock_django',
......
...@@ -5,6 +5,8 @@ Signal handlers are connected here. ...@@ -5,6 +5,8 @@ Signal handlers are connected here.
""" """
from django.apps import AppConfig from django.apps import AppConfig
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
class GradesConfig(AppConfig): class GradesConfig(AppConfig):
...@@ -20,3 +22,6 @@ class GradesConfig(AppConfig): ...@@ -20,3 +22,6 @@ class GradesConfig(AppConfig):
# Can't import models at module level in AppConfigs, and models get # Can't import models at module level in AppConfigs, and models get
# included from the signal handlers # included from the signal handlers
from .signals import handlers # pylint: disable=unused-variable from .signals import handlers # pylint: disable=unused-variable
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
from .services import GradesService
set_runtime_service('grades', GradesService())
"""
Instructor Application Configuration
"""
from django.apps import AppConfig
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
class InstructorConfig(AppConfig):
"""
Default configuration for the "lms.djangoapps.instructor" Django application.
"""
name = u'lms.djangoapps.instructor'
def ready(self):
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
from .services import InstructorService
set_runtime_service('instructor', InstructorService())
...@@ -2074,7 +2074,7 @@ INSTALLED_APPS = [ ...@@ -2074,7 +2074,7 @@ INSTALLED_APPS = [
'util', 'util',
'certificates.apps.CertificatesConfig', 'certificates.apps.CertificatesConfig',
'dashboard', 'dashboard',
'lms.djangoapps.instructor', 'lms.djangoapps.instructor.apps.InstructorConfig',
'lms.djangoapps.instructor_task', 'lms.djangoapps.instructor_task',
'openedx.core.djangoapps.course_groups', 'openedx.core.djangoapps.course_groups',
'bulk_email', 'bulk_email',
...@@ -2228,7 +2228,7 @@ INSTALLED_APPS = [ ...@@ -2228,7 +2228,7 @@ INSTALLED_APPS = [
'commerce', 'commerce',
# Credit courses # Credit courses
'openedx.core.djangoapps.credit', 'openedx.core.djangoapps.credit.apps.CreditConfig',
# Course teams # Course teams
'lms.djangoapps.teams', 'lms.djangoapps.teams',
......
...@@ -49,23 +49,6 @@ def run(): ...@@ -49,23 +49,6 @@ def run():
# Mako requires the directories to be added after the django setup. # Mako requires the directories to be added after the django setup.
microsite.enable_microsites(log) microsite.enable_microsites(log)
# register any dependency injections that we need to support in edx_proctoring
# right now edx_proctoring is dependent on the openedx.core.djangoapps.credit and
# lms.djangoapps.grades
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
# Import these here to avoid circular dependencies of the form:
# edx-platform app --> DRF --> django translation --> edx-platform app
from edx_proctoring.runtime import set_runtime_service
from lms.djangoapps.instructor.services import InstructorService
from openedx.core.djangoapps.credit.services import CreditService
from lms.djangoapps.grades.services import GradesService
set_runtime_service('credit', CreditService())
# register InstructorService (for deleting student attempts and user staff access roles)
set_runtime_service('instructor', InstructorService())
set_runtime_service('grades', GradesService())
# In order to allow modules to use a handler url, we need to # In order to allow modules to use a handler url, we need to
# monkey-patch the x_module library. # monkey-patch the x_module library.
# TODO: Remove this code when Runtimes are no longer created by modulestores # TODO: Remove this code when Runtimes are no longer created by modulestores
......
"""
Credit Application Configuration
"""
from django.apps import AppConfig
from django.conf import settings
from edx_proctoring.runtime import set_runtime_service
class CreditConfig(AppConfig):
"""
Default configuration for the "openedx.core.djangoapps.credit" Django application.
"""
name = u'openedx.core.djangoapps.credit'
def ready(self):
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
from .services import CreditService
set_runtime_service('credit', CreditService())
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