settings: Add setting for marking resolved-topic notices as read.

This commit adds a new personal setting
`resolved_topic_notice_auto_read_policy` which controls how
resolved-topic notices are marked as read for a user.

Fixes #33599.
This commit is contained in:
Saubhagya Patel
2025-05-13 00:08:07 +05:30
committed by Tim Abbott
parent 3d33a05455
commit 70e45f45c0
25 changed files with 500 additions and 82 deletions

View File

@@ -460,7 +460,11 @@ def check_realm_default_update(
assert prop in RealmUserDefault.property_types
prop_type = RealmUserDefault.property_types[prop]
assert isinstance(event["value"], prop_type)
value = event["value"]
if inspect.isclass(prop_type) and issubclass(prop_type, Enum):
assert isinstance(value, str)
else:
assert isinstance(value, prop_type)
def check_realm_update_dict(
@@ -620,7 +624,10 @@ def check_user_settings_update(
assert isinstance(value, str)
else:
setting_type = UserProfile.property_types[setting_name]
assert isinstance(value, setting_type)
if inspect.isclass(setting_type) and issubclass(setting_type, Enum):
assert isinstance(value, str)
else:
assert isinstance(value, setting_type)
if setting_name == "default_language":
assert "language_name" in event