diff --git a/cms/envs/common.py b/cms/envs/common.py index b23ffd9336..9508c77412 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1427,6 +1427,9 @@ INSTALLED_APPS = [ # signal handlers to capture course dates into edx-when 'openedx.core.djangoapps.course_date_signals', + + # Management of per-user schedules + 'openedx.core.djangoapps.schedules', ] diff --git a/lms/envs/common.py b/lms/envs/common.py index 8bc4198510..399b59f549 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2477,6 +2477,9 @@ INSTALLED_APPS = [ # Management of external user ids 'openedx.core.djangoapps.external_user_ids', + + # Management of per-user schedules + 'openedx.core.djangoapps.schedules', ] ######################### CSRF ######################################### diff --git a/openedx/core/djangoapps/schedules/apps.py b/openedx/core/djangoapps/schedules/apps.py index cfbbc53edc..510a28f352 100644 --- a/openedx/core/djangoapps/schedules/apps.py +++ b/openedx/core/djangoapps/schedules/apps.py @@ -10,23 +10,6 @@ class SchedulesConfig(AppConfig): name = 'openedx.core.djangoapps.schedules' verbose_name = _('Schedules') - plugin_app = { - PluginSignals.CONFIG: { - ProjectType.LMS: { - PluginSignals.RECEIVERS: [{ - PluginSignals.RECEIVER_FUNC_NAME: u'update_schedules_on_course_start_changed', - PluginSignals.SIGNAL_PATH: u'openedx.core.djangoapps.content.course_overviews.signals.COURSE_START_DATE_CHANGED', # pylint: disable=line-too-long - }] - }, - ProjectType.CMS: { - PluginSignals.RECEIVERS: [{ - PluginSignals.RECEIVER_FUNC_NAME: u'update_schedules_on_course_start_changed', - PluginSignals.SIGNAL_PATH: u'openedx.core.djangoapps.content.course_overviews.signals.COURSE_START_DATE_CHANGED', # pylint: disable=line-too-long - }] - }, - }, - } - def ready(self): # noinspection PyUnresolvedReferences from . import signals, tasks # pylint: disable=unused-variable diff --git a/openedx/core/djangoapps/schedules/signals.py b/openedx/core/djangoapps/schedules/signals.py index 39c371f110..3bfbed629d 100644 --- a/openedx/core/djangoapps/schedules/signals.py +++ b/openedx/core/djangoapps/schedules/signals.py @@ -17,6 +17,7 @@ from lms.djangoapps.courseware.models import ( DynamicUpgradeDeadlineConfiguration, OrgDynamicUpgradeDeadlineConfiguration ) +from openedx.core.djangoapps.content.course_overviews.signals import COURSE_START_DATE_CHANGED from openedx.core.djangoapps.schedules.content_highlights import course_has_highlights from openedx.core.djangoapps.schedules.models import ScheduleExperience from openedx.core.djangoapps.theming.helpers import get_current_site @@ -58,6 +59,7 @@ def create_schedule(sender, **kwargs): # pylint: disable=unused-argument )) +@receiver(COURSE_START_DATE_CHANGED) def update_schedules_on_course_start_changed(sender, updated_course_overview, previous_start_date, **kwargs): # pylint: disable=unused-argument """ Updates all course schedules start and upgrade_deadline dates based off of diff --git a/setup.py b/setup.py index a4d19b20b4..50f3640e67 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,6 @@ setup( "discussion = lms.djangoapps.discussion.apps:DiscussionConfig", "grades = lms.djangoapps.grades.apps:GradesConfig", "plugins = openedx.core.djangoapps.plugins.apps:PluginsConfig", - "schedules = openedx.core.djangoapps.schedules.apps:SchedulesConfig", "theming = openedx.core.djangoapps.theming.apps:ThemingConfig", "bookmarks = openedx.core.djangoapps.bookmarks.apps:BookmarksConfig", "zendesk_proxy = openedx.core.djangoapps.zendesk_proxy.apps:ZendeskProxyConfig", @@ -98,7 +97,6 @@ setup( "discussion = lms.djangoapps.discussion.apps:DiscussionConfig", "olx_rest_api = openedx.core.djangoapps.olx_rest_api.apps:OlxRestApiAppConfig", "plugins = openedx.core.djangoapps.plugins.apps:PluginsConfig", - "schedules = openedx.core.djangoapps.schedules.apps:SchedulesConfig", "theming = openedx.core.djangoapps.theming.apps:ThemingConfig", "bookmarks = openedx.core.djangoapps.bookmarks.apps:BookmarksConfig", "zendesk_proxy = openedx.core.djangoapps.zendesk_proxy.apps:ZendeskProxyConfig",