Move lti_provider startup.py to AppConfig::ready.

This commit is contained in:
John Eskew
2017-11-02 11:53:17 -04:00
parent c866b5261c
commit b02c744790
5 changed files with 19 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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')

View File

@@ -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

View File

@@ -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 ################################