From 6be232aa425354f8aa4864fbdf074b15db181df0 Mon Sep 17 00:00:00 2001 From: sahil839 Date: Wed, 26 May 2021 12:31:46 +0530 Subject: [PATCH] message_edit: Check 'topic_name is not None' and not 'content is None'. Previously when enforcing the check to do not allow editing topics after a certain time, we were checking whether 'content is None' and considering it as that if content is None then there must be topic edit. But after adding support for moving messages between streams it can be the case that we are neither changing topic nor content and just moving streams, and the original code raises error if this is done after the time limit of editing topics, which is wrong. This commit fixes this by actually checking 'topic_name is not None'. --- zerver/lib/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index f308ae9af0..ec5e1854ea 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2798,7 +2798,7 @@ def check_update_message( # sent the message, they are not the admin, and the time limit for editing # topics is passed, raise an error. if ( - content is None + topic_name is not None and message.sender != user_profile and not user_profile.is_realm_admin and not is_no_topic_msg