From 09bd0244b47e7d48942116a8c4661e98c27868f5 Mon Sep 17 00:00:00 2001 From: John Eskew Date: Wed, 8 Nov 2017 17:06:09 -0500 Subject: [PATCH] Move ccxcon, credit, and programs Django apps to AppConfig standard. --- lms/envs/common.py | 2 +- openedx/core/djangoapps/ccxcon/apps.py | 2 +- openedx/core/djangoapps/credit/__init__.py | 3 --- openedx/core/djangoapps/credit/apps.py | 1 + openedx/core/djangoapps/programs/__init__.py | 3 --- openedx/core/djangoapps/programs/apps.py | 14 ++++++++++++++ 6 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 openedx/core/djangoapps/programs/apps.py diff --git a/lms/envs/common.py b/lms/envs/common.py index d69a4d3840..74b0386cf8 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2251,7 +2251,7 @@ INSTALLED_APPS = [ 'xblock_django', # programs support - 'openedx.core.djangoapps.programs', + 'openedx.core.djangoapps.programs.apps.ProgramsConfig', # Catalog integration 'openedx.core.djangoapps.catalog', diff --git a/openedx/core/djangoapps/ccxcon/apps.py b/openedx/core/djangoapps/ccxcon/apps.py index 460e87392b..af16395c5d 100644 --- a/openedx/core/djangoapps/ccxcon/apps.py +++ b/openedx/core/djangoapps/ccxcon/apps.py @@ -10,4 +10,4 @@ class CCXConnectorConfig(AppConfig): verbose_name = "CCX Connector" def ready(self): - import openedx.core.djangoapps.ccxcon.signals + from . import signals diff --git a/openedx/core/djangoapps/credit/__init__.py b/openedx/core/djangoapps/credit/__init__.py index e5ef8a0674..e69de29bb2 100644 --- a/openedx/core/djangoapps/credit/__init__.py +++ b/openedx/core/djangoapps/credit/__init__.py @@ -1,3 +0,0 @@ -""" Register signal handlers """ - -from . import signals diff --git a/openedx/core/djangoapps/credit/apps.py b/openedx/core/djangoapps/credit/apps.py index eedac30579..49ca822c9b 100644 --- a/openedx/core/djangoapps/credit/apps.py +++ b/openedx/core/djangoapps/credit/apps.py @@ -14,6 +14,7 @@ class CreditConfig(AppConfig): name = u'openedx.core.djangoapps.credit' def ready(self): + from . import signals if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'): from .services import CreditService set_runtime_service('credit', CreditService()) diff --git a/openedx/core/djangoapps/programs/__init__.py b/openedx/core/djangoapps/programs/__init__.py index 3e2626d0bf..a6287c38bf 100644 --- a/openedx/core/djangoapps/programs/__init__.py +++ b/openedx/core/djangoapps/programs/__init__.py @@ -8,6 +8,3 @@ if and only if the service is deployed in the Open edX installation. To ensure maximum separation of concerns, and a minimum of interdependencies, this package should be kept small, thin, and stateless. """ - -# Register signal handlers -from . import signals diff --git a/openedx/core/djangoapps/programs/apps.py b/openedx/core/djangoapps/programs/apps.py new file mode 100644 index 0000000000..e6d87eab18 --- /dev/null +++ b/openedx/core/djangoapps/programs/apps.py @@ -0,0 +1,14 @@ +""" +Programs Configuration +""" +from django.apps import AppConfig + + +class ProgramsConfig(AppConfig): + """ + Default configuration for the "openedx.core.djangoapps.programs" Django application. + """ + name = u'openedx.core.djangoapps.programs' + + def ready(self): + from . import signals