settings: Remove unnecessary loop of notification_setting_types.

We still used notification_setting_types in copy_user_settings
function of create_user.py and in a test in test_event_system.py.
It is not required to do so since we have added all settings in
property_types already and we loop over property_types at both
these places which includes all settings.
This commit is contained in:
Sahil Batra 2021-09-09 15:36:19 +05:30 committed by Tim Abbott
parent 517c2ed39d
commit 526de3f7d1
2 changed files with 0 additions and 10 deletions

View File

@ -21,10 +21,6 @@ def copy_user_settings(source_profile: UserProfile, target_profile: UserProfile)
value = getattr(source_profile, settings_name)
setattr(target_profile, settings_name, value)
for settings_name in UserProfile.notification_setting_types:
value = getattr(source_profile, settings_name)
setattr(target_profile, settings_name, value)
setattr(target_profile, "full_name", source_profile.full_name)
setattr(target_profile, "enter_sends", source_profile.enter_sends)
setattr(target_profile, "timezone", source_profile.timezone)

View File

@ -557,9 +557,6 @@ class FetchInitialStateDataTest(ZulipTestCase):
for prop in UserProfile.property_types:
self.assertNotIn(prop, result)
self.assertIn(prop, result["user_settings"])
for prop in UserProfile.notification_setting_types:
self.assertNotIn(prop, result)
self.assertIn(prop, result["user_settings"])
result = fetch_initial_state_data(
user_profile=hamlet,
@ -569,9 +566,6 @@ class FetchInitialStateDataTest(ZulipTestCase):
for prop in UserProfile.property_types:
self.assertIn(prop, result)
self.assertIn(prop, result["user_settings"])
for prop in UserProfile.notification_setting_types:
self.assertIn(prop, result)
self.assertIn(prop, result["user_settings"])
class ClientDescriptorsTest(ZulipTestCase):