Allow users to submit empty content when editing messages.

The closest we have to deleting a message. Was original behavior, but was
changed in 09754c9.
This commit is contained in:
Rishi Gupta 2016-11-09 13:16:12 -08:00 committed by Tim Abbott
parent b0a8e4befe
commit 3c75ef2d79
2 changed files with 4 additions and 2 deletions

View File

@ -984,7 +984,9 @@ class EditMessageTest(ZulipTestCase):
'message_id': msg_id,
'content': ' '
})
self.assert_json_error(result, "Content can't be empty")
self.assert_json_success(result)
content = Message.objects.filter(id=msg_id).values_list('content', flat = True)[0]
self.assertEqual(content, "(deleted)")
def test_edit_message_content_limit(self):
# type: () -> None

View File

@ -911,7 +911,7 @@ def update_message_backend(request, user_profile,
if content is not None:
content = content.strip()
if content == "":
raise JsonableError(_("Content can't be empty"))
content = "(deleted)"
content = truncate_body(content)
# We exclude UserMessage.flags.historical rows since those