From db3bcb8889bcea68a0bd769503956228939536fb Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 25 Sep 2023 20:56:20 +0000 Subject: [PATCH] message_edit: len(changed_messages) is always > 0. It is only ever added to, and starts as a one-element list. --- zerver/actions/message_edit.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/zerver/actions/message_edit.py b/zerver/actions/message_edit.py index 3d2f5cea16..a36cf82429 100644 --- a/zerver/actions/message_edit.py +++ b/zerver/actions/message_edit.py @@ -996,7 +996,7 @@ def do_update_message( send_event(user_profile.realm, event, users_to_be_notified) resolved_topic_message_id = None - if topic_name is not None and content is None and len(changed_messages) > 0: + if topic_name is not None and content is None: # When stream is changed and topic is marked as resolved or unresolved # in the same API request, resolved or unresolved notification should # be sent to "new_stream". @@ -1014,11 +1014,7 @@ def do_update_message( changed_messages=changed_messages, ) - if ( - len(changed_messages) > 0 - and (new_stream is not None or topic_name is not None) - and stream_being_edited is not None - ): + if (new_stream is not None or topic_name is not None) and stream_being_edited is not None: # Notify users that the topic was moved. changed_messages_count = len(changed_messages)