zerver: API to create channel.

Fixes #16206.

Co-authored-by: Sahil Batra <sahil@zulip.com>
Co-authored-by: Steve Howell <showell@zulip.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This commit is contained in:
apoorvapendse
2025-07-02 11:26:37 +05:30
committed by Tim Abbott
parent 6ef2591b47
commit 6203861529
12 changed files with 750 additions and 22 deletions

View File

@@ -13,6 +13,7 @@ from zerver.lib.default_streams import get_default_stream_ids_for_realm
from zerver.lib.exceptions import (
CannotAdministerChannelError,
CannotSetTopicsPolicyError,
ChannelExistsError,
IncompatibleParametersError,
JsonableError,
OrganizationOwnerRequiredError,
@@ -992,7 +993,7 @@ def check_stream_name_available(realm: Realm, name: str) -> None:
check_stream_name(name)
try:
get_stream(name, realm)
raise JsonableError(_("Channel name is already in use."))
raise ChannelExistsError(name)
except Stream.DoesNotExist:
pass