From b02c744790f6506b2dfbe46c7d2bd6b68cf7534b Mon Sep 17 00:00:00 2001 From: John Eskew Date: Thu, 2 Nov 2017 11:53:17 -0400 Subject: [PATCH] Move lti_provider startup.py to AppConfig::ready. --- lms/djangoapps/lti_provider/apps.py | 16 ++++++++++++++++ lms/djangoapps/lti_provider/startup.py | 4 ---- lms/envs/aws.py | 2 +- lms/envs/test.py | 2 +- lms/envs/yaml_config.py | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 lms/djangoapps/lti_provider/apps.py delete mode 100644 lms/djangoapps/lti_provider/startup.py diff --git a/lms/djangoapps/lti_provider/apps.py b/lms/djangoapps/lti_provider/apps.py new file mode 100644 index 0000000000..a9d94ae21c --- /dev/null +++ b/lms/djangoapps/lti_provider/apps.py @@ -0,0 +1,16 @@ +""" +Configuration for the lti_provider Django application. +""" +from django.apps import AppConfig + + +class LtiProviderConfig(AppConfig): + """ + Configuration class for the lti_provider Django application. + """ + name = 'lti_provider' + verbose_name = "LTI Provider" + + def ready(self): + # Import the tasks module to ensure that signal handlers are registered. + from . import tasks # pylint: disable=unused-import diff --git a/lms/djangoapps/lti_provider/startup.py b/lms/djangoapps/lti_provider/startup.py deleted file mode 100644 index 24f5f6e505..0000000000 --- a/lms/djangoapps/lti_provider/startup.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code run at server start up to initialize the lti_provider app.""" - -# Import the tasks module to ensure that signal handlers are registered. -import lms.djangoapps.lti_provider.tasks # pylint: disable=unused-import diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 7be1753a7c..68d4f420ca 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -869,7 +869,7 @@ CREDIT_PROVIDER_SECRET_KEYS = AUTH_TOKENS.get("CREDIT_PROVIDER_SECRET_KEYS", {}) ##################### LTI Provider ##################### if FEATURES.get('ENABLE_LTI_PROVIDER'): - INSTALLED_APPS.append('lti_provider') + INSTALLED_APPS.append('lti_provider.apps.LtiProviderConfig') AUTHENTICATION_BACKENDS.append('lti_provider.users.LtiBackend') LTI_USER_EMAIL_DOMAIN = ENV_TOKENS.get('LTI_USER_EMAIL_DOMAIN', 'lti.example.com') diff --git a/lms/envs/test.py b/lms/envs/test.py index d683b05c47..41253eddfd 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -571,7 +571,7 @@ PROFILE_IMAGE_MIN_BYTES = 100 # Enable the LTI provider feature for testing FEATURES['ENABLE_LTI_PROVIDER'] = True -INSTALLED_APPS.append('lti_provider') +INSTALLED_APPS.append('lti_provider.apps.LtiProviderConfig') AUTHENTICATION_BACKENDS.append('lti_provider.users.LtiBackend') # ORGANIZATIONS diff --git a/lms/envs/yaml_config.py b/lms/envs/yaml_config.py index 83ed8b56b7..9517144ba5 100644 --- a/lms/envs/yaml_config.py +++ b/lms/envs/yaml_config.py @@ -319,7 +319,7 @@ if FEATURES.get('INDIVIDUAL_DUE_DATES'): ##################### LTI Provider ##################### if FEATURES.get('ENABLE_LTI_PROVIDER'): - INSTALLED_APPS.append('lti_provider') + INSTALLED_APPS.append('lti_provider.apps.LtiProviderConfig') AUTHENTICATION_BACKENDS.append('lti_provider.users.LtiBackend') ################################ Settings for Credentials Service ################################