Commit cb3a3780 by Alan Boudreault Committed by E. Kolpakov

Add ENABLE_DISCUSSION_EMAIL_DIGEST in api_manager

Conflicts:
	lms/djangoapps/api_manager/users/tests.py
parent bceb7a78
...@@ -35,8 +35,13 @@ from user_api.models import UserPreference ...@@ -35,8 +35,13 @@ from user_api.models import UserPreference
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore import Location from xmodule.modulestore import Location
from django.contrib.auth.models import User
from user_api.models import UserPreference
from notification_prefs import NOTIFICATION_PREF_KEY
TEST_API_KEY = str(uuid.uuid4()) TEST_API_KEY = str(uuid.uuid4())
class SecureClient(Client): class SecureClient(Client):
""" Django test client using a "secure" connection. """ """ Django test client using a "secure" connection. """
......
...@@ -22,6 +22,7 @@ from django_comment_common.models import Role, FORUM_ROLE_MODERATOR ...@@ -22,6 +22,7 @@ from django_comment_common.models import Role, FORUM_ROLE_MODERATOR
from gradebook.models import StudentGradebook from gradebook.models import StudentGradebook
from instructor.access import revoke_access, update_forum_role from instructor.access import revoke_access, update_forum_role
from lang_pref import LANGUAGE_KEY from lang_pref import LANGUAGE_KEY
from notification_prefs.views import enable_notifications
from lms.lib.comment_client.user import User as CommentUser from lms.lib.comment_client.user import User as CommentUser
from lms.lib.comment_client.utils import CommentClientRequestError from lms.lib.comment_client.utils import CommentClientRequestError
from notification_prefs.views import enable_notifications from notification_prefs.views import enable_notifications
...@@ -336,6 +337,9 @@ class UsersList(SecureListAPIView): ...@@ -336,6 +337,9 @@ class UsersList(SecureListAPIView):
if settings.FEATURES.get('ENABLE_DISCUSSION_EMAIL_DIGEST'): if settings.FEATURES.get('ENABLE_DISCUSSION_EMAIL_DIGEST'):
enable_notifications(user) enable_notifications(user)
if settings.FEATURES.get('ENABLE_DISCUSSION_EMAIL_DIGEST'):
enable_notifications(user)
# add this account creation to password history # add this account creation to password history
# NOTE, this will be a NOP unless the feature has been turned on in configuration # NOTE, this will be a NOP unless the feature has been turned on in configuration
password_history_entry = PasswordHistory() password_history_entry = PasswordHistory()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment