From 151fbd832cf7613d6ceee2e48e1e850ea5b7ab75 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Tue, 19 Nov 2013 14:26:16 -0500 Subject: [PATCH] do_update_message: use is_admin to check who can edit a topic. (imported from commit e96245506c7eecc8aed3fbdb6dfb7c44aca3234e) --- zerver/lib/actions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 96c10a68ef..cd27e178a3 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1427,9 +1427,8 @@ def do_update_message(user_profile, message_id, subject, propagate_mode, content # 3. This is a topic-only edit and you are an admin. if message.sender == user_profile: pass - elif (content is None) and \ - ((message.subject == "(no topic)") or - (user_profile in user_profile.realm.get_admin_users())): + elif (content is None) and ((message.subject == "(no topic)") or + user_profile.is_admin()): pass else: raise JsonableError("You don't have permission to edit this message")