refactor: update non-editable into snake case non_editable (#32654)
This commit is contained in:
@@ -31,7 +31,7 @@ COURSE_NOTIFICATION_TYPES = {
|
||||
'email': True,
|
||||
'push': True,
|
||||
'info': 'Comment on post',
|
||||
'non-editable': ['web', 'email'],
|
||||
'non_editable': ['web', 'email'],
|
||||
'content_template': _('<{p}><{strong}>{replier_name}</{strong}> replied on <{strong}>{author_name}'
|
||||
'</{strong}> response to your post <{strong}>{post_title}</{strong}></{p}>'),
|
||||
'content_context': {
|
||||
@@ -49,7 +49,7 @@ COURSE_NOTIFICATION_TYPES = {
|
||||
'email': True,
|
||||
'push': True,
|
||||
'info': 'Response on post',
|
||||
'non-editable': [],
|
||||
'non_editable': [],
|
||||
'content_template': _('<{p}><{strong}>{replier_name}</{strong}> responded to your '
|
||||
'post <{strong}>{post_title}</{strong}></{p}>'),
|
||||
'content_context': {
|
||||
@@ -206,13 +206,13 @@ class NotificationTypeManager:
|
||||
@staticmethod
|
||||
def get_non_editable_notification_channels(notification_types):
|
||||
"""
|
||||
Returns non-editable notification channels for the given notification types.
|
||||
Returns non_editable notification channels for the given notification types.
|
||||
"""
|
||||
non_editable_notification_channels = {}
|
||||
for notification_type in notification_types:
|
||||
if notification_type.get('non-editable', None):
|
||||
if notification_type.get('non_editable', None):
|
||||
non_editable_notification_channels[notification_type.get('name')] = \
|
||||
notification_type.get('non-editable')
|
||||
notification_type.get('non_editable')
|
||||
return non_editable_notification_channels
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -106,7 +106,7 @@ class NotificationPreferenceSyncManagerTest(ModuleStoreTestCase):
|
||||
'email': True,
|
||||
'push': True,
|
||||
'info': '',
|
||||
'non-editable': [],
|
||||
'non_editable': [],
|
||||
'content_template': '',
|
||||
'content_context': {},
|
||||
'email_template': '',
|
||||
@@ -187,16 +187,16 @@ class NotificationPreferenceSyncManagerTest(ModuleStoreTestCase):
|
||||
|
||||
def test_non_editable_addition_and_removal(self):
|
||||
"""
|
||||
Tests if non-editable updates on existing preferences
|
||||
Tests if non_editable updates on existing preferences
|
||||
"""
|
||||
current_config_version = get_course_notification_preference_config_version()
|
||||
base_notification.COURSE_NOTIFICATION_TYPES[self.default_type_name]['non-editable'] = ['web']
|
||||
base_notification.COURSE_NOTIFICATION_TYPES[self.default_type_name]['non_editable'] = ['web']
|
||||
self._set_notification_config_version(current_config_version + 1)
|
||||
new_config = CourseNotificationPreference.get_updated_user_course_preferences(self.user, self.course.id)
|
||||
preferences = new_config.notification_preference_config
|
||||
preference_non_editable = preferences[self.default_app_name]['non_editable'][self.default_type_name]
|
||||
assert 'web' in preference_non_editable
|
||||
base_notification.COURSE_NOTIFICATION_TYPES[self.default_type_name]['non-editable'] = []
|
||||
base_notification.COURSE_NOTIFICATION_TYPES[self.default_type_name]['non_editable'] = []
|
||||
self._set_notification_config_version(current_config_version + 2)
|
||||
new_config = CourseNotificationPreference.get_updated_user_course_preferences(self.user, self.course.id)
|
||||
preferences = new_config.notification_preference_config
|
||||
|
||||
Reference in New Issue
Block a user