Use '[deleted]' instead of failing if you edit a message to empty.

Trac #1571

(imported from commit a51602d72aa2b89ce451946ae7f5a5363a6421f4)
This commit is contained in:
Kevin Mehall
2013-08-21 16:49:14 -04:00
parent f944a8ed0e
commit 8b365a5681

View File

@@ -990,8 +990,8 @@ def do_update_message(user_profile, message_id, subject, content):
first_rendered_content = old_edit_history_event['prev_rendered_content']
if content is not None:
if content == "":
raise JsonableError("Message can't be empty")
if len(content.strip()) == 0:
content = "[deleted]"
if len(content) > MAX_MESSAGE_LENGTH:
raise JsonableError("Message too long")
rendered_content = message.render_markdown(content)