settings: Add a new topics_policy realm setting.

Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
This commit is contained in:
Vector73
2025-06-14 11:19:57 +00:00
committed by Tim Abbott
parent 8fb1eeeb09
commit 62c67eae8e
38 changed files with 313 additions and 57 deletions

View File

@@ -118,6 +118,7 @@ from zerver.lib.event_types import (
PersonRole,
PersonTimezone,
PlanTypeData,
RealmTopicsPolicyData,
)
from zerver.lib.topic import ORIG_TOPIC, TOPIC_NAME
from zerver.lib.types import UserGroupMembersDict
@@ -506,6 +507,8 @@ def check_realm_update_dict(
sub_type = GroupSettingUpdateData
elif "plan_type" in event["data"]:
sub_type = PlanTypeData
elif "topics_policy" in event["data"]:
sub_type = RealmTopicsPolicyData
else:
raise AssertionError("unhandled fields in data")