mirror of https://github.com/zulip/zulip.git
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:
parent
b0a8e4befe
commit
3c75ef2d79
|
@ -984,7 +984,9 @@ class EditMessageTest(ZulipTestCase):
|
||||||
'message_id': msg_id,
|
'message_id': msg_id,
|
||||||
'content': ' '
|
'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):
|
def test_edit_message_content_limit(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
|
|
@ -911,7 +911,7 @@ def update_message_backend(request, user_profile,
|
||||||
if content is not None:
|
if content is not None:
|
||||||
content = content.strip()
|
content = content.strip()
|
||||||
if content == "":
|
if content == "":
|
||||||
raise JsonableError(_("Content can't be empty"))
|
content = "(deleted)"
|
||||||
content = truncate_body(content)
|
content = truncate_body(content)
|
||||||
|
|
||||||
# We exclude UserMessage.flags.historical rows since those
|
# We exclude UserMessage.flags.historical rows since those
|
||||||
|
|
Loading…
Reference in New Issue