Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

streams: Use case-insensitive name check in do_unarchive_stream.

Tim Abbotte119f6408d44
diff --git a/zerver/actions/streams.py b/zerver/actions/streams.py
index a2dd27860a8..75e89444973 100644
--- a/zerver/actions/streams.py
+++ b/zerver/actions/streams.py
@@ -231,7 +231,10 @@ def do_unarchive_stream(stream: Stream, new_name: str, *, acting_user: UserProfi
if not stream.deactivated:
raise JsonableError(_("Channel is not currently deactivated"))
- if stream.name != new_name and Stream.objects.filter(realm=realm, name=new_name).exists():
+ if (
+ stream.name != new_name
+ and Stream.objects.filter(realm=realm, name__iexact=new_name).exists()
+ ):
raise JsonableError(
_("Channel named {channel_name} already exists").format(channel_name=new_name)
)