Add ENABLE_DISCUSSION_EMAIL_DIGEST feature, to enable discussion emails digest by default for all users
This commit is contained in:
committed by
Matjaz Gregoric
parent
c6aa4416c4
commit
ac445d6eff
@@ -86,6 +86,7 @@ from bulk_email.models import Optout, CourseAuthorization
|
||||
import shoppingcart
|
||||
from openedx.core.djangoapps.user_api.models import UserPreference
|
||||
from lang_pref import LANGUAGE_KEY
|
||||
from notification_prefs.views import enable_notifications
|
||||
|
||||
import track.views
|
||||
|
||||
@@ -1589,6 +1590,12 @@ def create_account(request, post_override=None): # pylint: disable-msg=too-many
|
||||
|
||||
(user, profile, registration) = ret
|
||||
|
||||
if settings.FEATURES.get('ENABLE_DISCUSSION_EMAIL_DIGEST'):
|
||||
try:
|
||||
enable_notifications(user)
|
||||
except Exception:
|
||||
log.exception("Enable discussion notifications failed for user {id}.".format(id=user.id))
|
||||
|
||||
dog_stats_api.increment("common.student.account_created")
|
||||
|
||||
email = post_vars['email']
|
||||
|
||||
Reference in New Issue
Block a user