Skip to content

Commit

Permalink
fix: make course update email pref false (#35224)
Browse files Browse the repository at this point in the history
fix: updated unit tests

fix: updated unit tests
  • Loading branch information
AhtishamShahid authored Aug 7, 2024
1 parent 834dc31 commit 9bd6924
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ def send_course_update_notification(course_key, content, user):
"course_update_content": text_content if len(text_content.strip()) < 10 else "Click here to view",
**extra_context,
},
notification_type="course_update",
notification_type="course_updates",
content_url=f"{settings.LMS_ROOT_URL}/courses/{str(course_key)}/course/updates",
app_name="updates",
audience_filters={},
Expand Down
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/notifications/base_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@
'email_template': '',
'filters': [FILTER_AUDIT_EXPIRED_USERS_WITH_NO_ROLE]
},
'course_update': {
'course_updates': {
'notification_app': 'updates',
'name': 'course_update',
'name': 'course_updates',
'is_core': False,
'info': '',
'web': True,
'email': True,
'email': False,
'push': True,
'email_cadence': EmailCadence.DAILY,
'non_editable': [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_create_app_notifications_dict(self):
"""
Notification.objects.all().delete()
create_notification(self.user, self.course.id, app_name='discussion', notification_type='new_comment')
create_notification(self.user, self.course.id, app_name='updates', notification_type='course_update')
create_notification(self.user, self.course.id, app_name='updates', notification_type='course_updates')
app_dict = create_app_notifications_dict(Notification.objects.all())
assert len(app_dict.keys()) == 2
for key in ['discussion', 'updates']:
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_email_digest_context(self, digest_frequency):
discussion_notification = create_notification(self.user, self.course.id, app_name='discussion',
notification_type='new_comment')
update_notification = create_notification(self.user, self.course.id, app_name='updates',
notification_type='course_update')
notification_type='course_updates')
app_dict = create_app_notifications_dict(Notification.objects.all())
end_date = datetime.datetime(2024, 3, 24, 12, 0)
params = {
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ADDITIONAL_NOTIFICATION_CHANNEL_SETTINGS = ['email_cadence']

# Update this version when there is a change to any course specific notification type or app.
COURSE_NOTIFICATION_CONFIG_VERSION = 10
COURSE_NOTIFICATION_CONFIG_VERSION = 11


def get_course_notification_preference_config():
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/notifications/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def test_app_name_param(self):
"""
assert not Notification.objects.all()
create_notification(self.user, self.course_1.id, app_name='discussion', notification_type='new_comment')
create_notification(self.user, self.course_1.id, app_name='updates', notification_type='course_update')
create_notification(self.user, self.course_1.id, app_name='updates', notification_type='course_updates')
delete_notifications({'app_name': 'discussion'})
assert not Notification.objects.filter(app_name='discussion')
assert Notification.objects.filter(app_name='updates')
Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/notifications/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ def _expected_api_response(self, course=None):
'enabled': True,
'core_notification_types': [],
'notification_types': {
'course_update': {
'course_updates': {
'web': True,
'email': True,
'email': False,
'push': True,
'email_cadence': 'Daily',
'info': ''
Expand Down

0 comments on commit 9bd6924

Please sign in to comment.