create-channel: Remove send_new_subscription_messages parameter.

Removes send_new_subscription_messages parameter from
`POST channel/create` endpoint as Notification Bot DMs
are never sent when users are subscribed as part of
creating a new channel.

Not considered a documentable API change, since the previous parameter
never had any effect, so this is effectively just a documentation and
error-handling bug fix, not an API change relevant to implementors.
This commit is contained in:
Lauryn Menard
2025-08-25 16:49:15 +02:00
committed by Tim Abbott
parent dda2c6e285
commit 699c0c6200
3 changed files with 23 additions and 15 deletions

View File

@@ -24,6 +24,7 @@ from zerver.models import (
Message,
NamedUserGroup,
Realm,
Recipient,
Stream,
Subscription,
UserMessage,
@@ -303,6 +304,18 @@ class TestCreateStreams(ZulipTestCase):
self.assertEqual(stream.name, "testchannel")
self.assertEqual(stream.description, "test channel")
# Confirm channel created notification message in channel events topic.
message = self.get_last_message()
self.assertEqual(message.recipient.type, Recipient.STREAM)
self.assertEqual(message.recipient.type_id, stream.id)
self.assertEqual(message.topic_name(), Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME)
self.assertEqual(message.sender_id, self.notification_bot(user_profile.realm).id)
expected_message_content = (
f"**Public** channel created by @_**{user_profile.full_name}|{user_profile.id}**. **Description:**\n"
"```` quote\ntest channel\n````"
)
self.assertEqual(message.content, expected_message_content)
# Creating an existing channel should return an error.
result = self.create_channel_via_post(user_profile, name="basketball")
self.assert_json_error(result, "Channel 'basketball' already exists", status_code=409)