From 8314971e0b369431d7f496b3d39f4b87267af5a4 Mon Sep 17 00:00:00 2001 From: stvn Date: Tue, 2 Feb 2021 15:32:15 -0800 Subject: [PATCH] refactor: Convert discussions to pluggable app This minimizes our footprint outside of the djangoapp, now and moving forward. Not only can we drop the `lms/envs/common.py` change, but we can also avoid touching `lms/urls.py` when we add the API. Everything can stay contained within `openedx/core/djangoapps/discussions`. --- lms/envs/common.py | 1 - openedx/core/djangoapps/discussions/apps.py | 8 ++++++++ setup.py | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 9726759636..2471b8fcf7 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2867,7 +2867,6 @@ INSTALLED_APPS = [ # Discussion forums 'openedx.core.djangoapps.django_comment_common', - 'openedx.core.djangoapps.discussions', # Notes 'lms.djangoapps.edxnotes', diff --git a/openedx/core/djangoapps/discussions/apps.py b/openedx/core/djangoapps/discussions/apps.py index 51b2803668..7ecc1e0c1a 100644 --- a/openedx/core/djangoapps/discussions/apps.py +++ b/openedx/core/djangoapps/discussions/apps.py @@ -2,6 +2,8 @@ Configure the django app """ from django.apps import AppConfig +from edx_django_utils.plugins import PluginSettings +from edx_django_utils.plugins import PluginURLs class DiscussionsConfig(AppConfig): @@ -9,3 +11,9 @@ class DiscussionsConfig(AppConfig): Configure the discussions django app """ name = 'openedx.core.djangoapps.discussions' + plugin_app = { + PluginURLs.CONFIG: { + }, + PluginSettings.CONFIG: { + }, + } diff --git a/setup.py b/setup.py index 30c0efc8ad..5884b26330 100644 --- a/setup.py +++ b/setup.py @@ -83,6 +83,7 @@ setup( "credentials = openedx.core.djangoapps.credentials.apps:CredentialsConfig", "content_libraries = openedx.core.djangoapps.content_libraries.apps:ContentLibrariesConfig", "discussion = lms.djangoapps.discussion.apps:DiscussionConfig", + "discussions = openedx.core.djangoapps.discussions.apps:DiscussionsConfig", "grades = lms.djangoapps.grades.apps:GradesConfig", "plugins = openedx.core.djangoapps.plugins.apps:PluginsConfig", "theming = openedx.core.djangoapps.theming.apps:ThemingConfig",