Files
edx-platform/openedx/core/djangoapps/credentials/apps.py
Calen Pennington 2714da86a4 Always import task packages by absolute paths
This follows the recommendation in the Celery documentation so as to
not confuse automatic task name generation.

Docs: https://docs.celeryproject.org/en/stable/userguide/tasks.html#automatic-naming-and-relative-imports
2020-10-08 14:10:17 -04:00

48 lines
1.7 KiB
Python

"""
Credentials Configuration
"""
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from edx_django_utils.plugins import PluginSettings, PluginSignals
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType
class CredentialsConfig(AppConfig):
"""
Configuration class for credentials Django app
"""
name = 'openedx.core.djangoapps.credentials'
verbose_name = _("Credentials")
plugin_app = {
PluginSettings.CONFIG: {
ProjectType.LMS: {
SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'},
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'},
SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'},
SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'},
}
},
PluginSignals.CONFIG: {
ProjectType.LMS: {
PluginSignals.RECEIVERS: [
{
PluginSignals.RECEIVER_FUNC_NAME: u'handle_grade_change',
PluginSignals.SIGNAL_PATH: u'openedx.core.djangoapps.signals.signals.COURSE_GRADE_CHANGED',
},
{
PluginSignals.RECEIVER_FUNC_NAME: u'handle_cert_change',
PluginSignals.SIGNAL_PATH: u'openedx.core.djangoapps.signals.signals.COURSE_CERT_CHANGED',
},
],
},
},
}
def ready(self):
# Register celery workers
from openedx.core.djangoapps.credentials.tasks.v1 import tasks # pylint: disable=unused-variable