message_edit: Do case-insensitive exact match when editing topics.

When doing query for same topic names in a stream, we should do a
case-insensitive exact match for the topic, since that's the data
model for topics in Zulip.
This commit is contained in:
Aman Agrawal
2020-06-13 16:09:11 +05:30
committed by Tim Abbott
parent be40a3da99
commit 2e5f860d41
2 changed files with 3 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ def update_messages_for_topic_edit(message: Message,
orig_topic_name: str,
topic_name: Optional[str],
new_stream: Optional[Stream]) -> List[Message]:
propagate_query = Q(recipient = message.recipient, subject = orig_topic_name)
propagate_query = Q(recipient = message.recipient, subject__iexact = orig_topic_name)
if propagate_mode == 'change_all':
propagate_query = propagate_query & ~Q(id = message.id)
if propagate_mode == 'change_later':