mirror of https://github.com/zulip/zulip.git
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:
parent
517c2ed39d
commit
526de3f7d1
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue