Skip to content

Commit

Permalink
fix: added new_comment and new_response to core notification (#32894)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadadeeltajamul authored Aug 7, 2023
1 parent 7f06e72 commit f90f1af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
12 changes: 3 additions & 9 deletions openedx/core/djangoapps/notifications/base_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
'new_comment': {
'notification_app': 'discussion',
'name': 'new_comment',
'is_core': False,
'web': True,
'email': True,
'push': True,
'is_core': True,
'info': 'Comment on post',
'non_editable': ['web', 'email'],
'content_template': _('<{p}><{strong}>{replier_name}</{strong}> commented on <{strong}>{author_name}\'s'
Expand All @@ -43,10 +40,7 @@
'new_response': {
'notification_app': 'discussion',
'name': 'new_response',
'is_core': False,
'web': True,
'email': True,
'push': True,
'is_core': True,
'info': 'Response on post',
'non_editable': [],
'content_template': _('<{p}><{strong}>{replier_name}</{strong}> responded to your '
Expand All @@ -66,7 +60,7 @@
'core_web': True,
'core_email': True,
'core_push': True,
'non_editable': []
'non_editable': ['web']
}
}

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 @@ -21,7 +21,7 @@
NOTIFICATION_CHANNELS = ['web', 'push', 'email']

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


def get_course_notification_preference_config():
Expand Down
19 changes: 2 additions & 17 deletions openedx/core/djangoapps/notifications/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,8 @@ def _expected_api_response(self):
'notification_preference_config': {
'discussion': {
'enabled': True,
'core_notification_types': ['new_comment_on_response'],
'core_notification_types': ['new_comment_on_response', 'new_comment', 'new_response'],
'notification_types': {
'new_comment': {
'web': True,
'email': True,
'push': True,
'info': 'Comment on post'
},
'new_response': {
'web': True,
'email': True,
'push': True,
'info': 'Response on post'
},
'core': {
'web': True,
'email': True,
Expand All @@ -239,7 +227,7 @@ def _expected_api_response(self):
}
},
'non_editable': {
'new_comment': ['web', 'email']
'core': ['web']
}
}
}
Expand Down Expand Up @@ -269,9 +257,6 @@ def test_get_user_notification_preference(self, mock_emit):
('discussion', None, None, False, status.HTTP_200_OK, 'app_update'),
('invalid_notification_app', None, None, True, status.HTTP_400_BAD_REQUEST, None),
('discussion', 'new_comment', 'web', True, status.HTTP_200_OK, 'type_update'),
('discussion', 'new_response', 'web', False, status.HTTP_200_OK, 'type_update'),
('discussion', 'core', 'email', True, status.HTTP_200_OK, 'type_update'),
('discussion', 'core', 'email', False, status.HTTP_200_OK, 'type_update'),
Expand Down

0 comments on commit f90f1af

Please sign in to comment.