From 8328c9fdb0401f46d7c702e98228513123607545 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Fri, 15 Nov 2024 16:26:18 +0530 Subject: [PATCH] delete_topic: Add support for empty topic name. --- zerver/views/streams.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zerver/views/streams.py b/zerver/views/streams.py index 6f0246cba5..bf5b7cc8ba 100644 --- a/zerver/views/streams.py +++ b/zerver/views/streams.py @@ -70,6 +70,7 @@ from zerver.lib.subscription_info import gather_subscriptions from zerver.lib.topic import ( get_topic_history_for_public_stream, get_topic_history_for_stream, + maybe_rename_general_chat_to_empty_topic, messages_for_topic, ) from zerver.lib.typed_endpoint import ApiParamConfig, PathOnly, typed_endpoint @@ -926,6 +927,7 @@ def delete_in_topic( topic_name: str, ) -> HttpResponse: stream, ignored_sub = access_stream_by_id(user_profile, stream_id) + topic_name = maybe_rename_general_chat_to_empty_topic(topic_name) messages = messages_for_topic( user_profile.realm_id, assert_is_not_none(stream.recipient_id), topic_name