mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
settings: Migrate twenty_four_hour_time setting to RealmUserDefault.
This commit removes the existing default_twenty_four_hour_time field in Realm table which was used to set the twenty_four_hour_time setting of new user on joining and instead we now use the twenty_four_hour_time field of RealmUserDefault table for the same. With some tweaks by tabbott to clarify the documentation.
This commit is contained in:
@@ -29,9 +29,7 @@ def copy_default_settings(
|
||||
#
|
||||
# Note that this function will do at least one save() on target_profile.
|
||||
for settings_name in UserBaseSettings.property_types:
|
||||
if settings_name in ["default_language", "twenty_four_hour_time"] and isinstance(
|
||||
settings_source, RealmUserDefault
|
||||
):
|
||||
if settings_name == "default_language" and isinstance(settings_source, RealmUserDefault):
|
||||
continue
|
||||
value = getattr(settings_source, settings_name)
|
||||
setattr(target_profile, settings_name, value)
|
||||
@@ -110,7 +108,6 @@ def create_user_profile(
|
||||
enter_sends=enter_sends,
|
||||
onboarding_steps=orjson.dumps([]).decode(),
|
||||
default_language=realm.default_language,
|
||||
twenty_four_hour_time=realm.default_twenty_four_hour_time,
|
||||
delivery_email=email,
|
||||
**extra_kwargs,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user