mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
stream_settings: Add new disable_topics option to topics_policy.
Adds new configuration option `disable_topics` in `topics_policy` channel setting to support disabling topics in the channel. Fixes #34553.
This commit is contained in:
@@ -264,9 +264,19 @@ def get_user_ids_with_metadata_access_via_permission_groups(stream: Stream) -> s
|
||||
|
||||
|
||||
def channel_events_topic_name(stream: Stream) -> str:
|
||||
if stream.topics_policy == StreamTopicsPolicyEnum.empty_topic_only.value:
|
||||
return ""
|
||||
return str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME)
|
||||
|
||||
|
||||
def channel_has_named_topics(stream: Stream) -> bool:
|
||||
return (
|
||||
Message.objects.filter(realm_id=stream.realm_id, recipient=stream.recipient)
|
||||
.exclude(subject="")
|
||||
.exists()
|
||||
)
|
||||
|
||||
|
||||
@transaction.atomic(savepoint=False)
|
||||
def create_stream_if_needed(
|
||||
realm: Realm,
|
||||
|
||||
Reference in New Issue
Block a user