Files
edx-platform/lms/djangoapps/discussion/apps.py
David Ormsbee 72ed987dff Enable model-caching of discussions ID mapping.
Doing modulestore lookups is expensive, so commit 695b036 created a
course_publish listener that would materialize the discussion ID to
XBlock usage key mapping into the CourseDiscussionSettings model.

However, the signal wasn't hooked up to the Studio process, so that
async task was never called. When hooking it up, I also discovered that
bok choy tests related to partitioning were failing because of a race
condition where multiple processes are overwriting the discussion
settings. To make sure this wasn't an issue, I moved the mapping to
its own table.

This is part of ARCH-111, and the overall Course Structures API
deprecation.
2018-06-13 08:21:08 -04:00

42 lines
1.2 KiB
Python

"""
Discussion Application Configuration
Signal handlers are connected here.
"""
from django.apps import AppConfig
from openedx.core.constants import COURSE_ID_PATTERN
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class DiscussionConfig(AppConfig):
"""
Application Configuration for Grades.
"""
name = u'lms.djangoapps.discussion'
plugin_app = {
PluginURLs.CONFIG: {
ProjectType.LMS: {
PluginURLs.NAMESPACE: u'',
PluginURLs.REGEX: r'^courses/{}/discussion/forum/'.format(COURSE_ID_PATTERN),
PluginURLs.RELATIVE_PATH: u'urls',
}
},
PluginSettings.CONFIG: {
ProjectType.CMS: {
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'},
},
ProjectType.LMS: {
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'},
},
}
}
def ready(self):
"""
Connect handlers to send notifications about discussions.
"""
from .signals import handlers # pylint: disable=unused-variable