Skip to content

Commit

Permalink
Move notifier and notification_prefs to discussion/
Browse files Browse the repository at this point in the history
  • Loading branch information
nasthagiri committed May 3, 2019
1 parent e160b23 commit 7b4b6c3
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 22 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ common/lib/xmodule/xmodule/html_module.py @edx/platform-core-extensions
common/lib/xmodule/xmodule/video_module @edx/platform-core-extensions
lms/djangoapps/discussion/ @edx/platform-core-extensions
lms/djangoapps/edxnotes @edx/platform-core-extensions
lms/djangoapps/notifier_api/ @edx/platform-core-extensions

# Analytics
common/djangoapps/track/ @edx/edx-data-engineering
Expand Down
2 changes: 0 additions & 2 deletions lms/djangoapps/discussion/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Discussions related functionality is scattered across a number of places and sho

* ``common/djangoapps/django_comment_common``
* ``lms/djangoapps/discussion``
* ``lms/djangoapps/notification_prefs``
* ``lms/djangoapps/notifier_api``
* ``openedx/core/lib/xblock_builtin/xblock_discussion``

Ideally, what we want in the long term is for all of this extracted into a new repository that holds the code for both the inline discussion XBlock as well as all the Django apps. Use of the notifier API should be replaced with edx-ace.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth.models import User
from lettuce import step, world

from notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference, set_user_preference

USERNAME = "robot"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
from django.test.utils import override_settings
from mock import patch

from notification_prefs import NOTIFICATION_PREF_KEY
from notification_prefs.views import UsernameCipher, ajax_disable, ajax_enable, ajax_status, set_subscription
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notification_prefs.views import (
UsernameCipher, ajax_disable, ajax_enable, ajax_status, set_subscription,
)
from openedx.core.djangoapps.user_api.models import UserPreference
from student.tests.factories import UserFactory
from util.testing import UrlResetMixin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from six import text_type

from edxmako.shortcuts import render_to_response
from notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from openedx.core.djangoapps.user_api.models import UserPreference
from openedx.core.djangoapps.user_api.preferences.api import delete_user_preference

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.http import Http404
from rest_framework import serializers

from lms.djangoapps.notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from opaque_keys.edx.locator import CourseLocator

from django_comment_common.models import Permission, Role
from notification_prefs import NOTIFICATION_PREF_KEY
from notifier_api.views import NotifierUsersViewSet
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notifier_api.views import NotifierUsersViewSet
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.user_api.models import UserPreference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.conf.urls import include, url
from rest_framework import routers

from notifier_api.views import NotifierUsersViewSet
from lms.djangoapps.discussion.notifier_api.views import NotifierUsersViewSet

notifier_api_router = routers.DefaultRouter()
notifier_api_router.register(r'users', NotifierUsersViewSet, base_name="notifier_users")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from rest_framework.response import Response
from rest_framework.viewsets import ReadOnlyModelViewSet

from notification_prefs import NOTIFICATION_PREF_KEY
from notifier_api.serializers import NotifierUserSerializer
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notifier_api.serializers import NotifierUserSerializer
from openedx.core.lib.api.permissions import ApiKeyHeaderPermission


Expand Down
5 changes: 0 additions & 5 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2139,11 +2139,6 @@ def _make_locale_paths(settings):
# Shopping cart
'shoppingcart',

# Notification preferences setting
'notification_prefs',

'notifier_api',

# Different Course Modes
'course_modes.apps.CourseModesConfig',

Expand Down
4 changes: 2 additions & 2 deletions lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
from django_comment_common.models import ForumsConfig
from lms.djangoapps.certificates import views as certificates_views
from lms.djangoapps.discussion import views as discussion_views
from lms.djangoapps.discussion.notification_prefs import views as notification_prefs_views
from lms.djangoapps.instructor.views import coupons as instructor_coupons_views
from lms.djangoapps.instructor.views import instructor_dashboard as instructor_dashboard_views
from lms.djangoapps.instructor.views import registration_codes as instructor_registration_codes_views
from lms.djangoapps.instructor_task import views as instructor_task_views
from notes import views as notes_views
from notification_prefs import views as notification_prefs_views
from openedx.core.djangoapps.auth_exchange.views import LoginWithAccessTokenView
from openedx.core.djangoapps.catalog.models import CatalogIntegration
from openedx.core.djangoapps.common_views.xblock import xblock_resource
Expand Down Expand Up @@ -84,7 +84,7 @@
# subsumed by api/user listed below.
url(r'^user_api/', include('openedx.core.djangoapps.user_api.legacy_urls')),

url(r'^notifier_api/', include('notifier_api.urls')),
url(r'^notifier_api/', include('lms.djangoapps.discussion.notifier_api.urls')),

url(r'^i18n/', include('django.conf.urls.i18n')),

Expand Down
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/user_authn/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
from django.dispatch import Signal
from django.utils.translation import get_language
from django.utils.translation import ugettext as _

# Note that this lives in LMS, so this dependency should be refactored.
from notification_prefs.views import enable_notifications
# TODO Have the discussions code subscribe to the REGISTER_USER signal instead.
from lms.djangoapps.discussion.notification_prefs.views import enable_notifications
from pytz import UTC
from requests import HTTPError
from six import text_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from django.contrib.auth.hashers import make_password

from django_comment_common.models import ForumsConfig
from notification_prefs import NOTIFICATION_PREF_KEY
from lms.djangoapps.discussion.notification_prefs import NOTIFICATION_PREF_KEY
from openedx.core.djangoapps.user_authn.views.register import (
REGISTRATION_AFFILIATE_ID, REGISTRATION_UTM_CREATED_AT, REGISTRATION_UTM_PARAMETERS,
_skip_activation_email,
Expand Down

0 comments on commit 7b4b6c3

Please sign in to comment.