mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
settings: Make MAX_MESSAGE_LENGTH a server-level setting.
This will offer users who are self-hosting to adjust this value. Moreover, this will help to reduce the overall time taken to test `test_markdown.py` (since this can be now overridden with `override_settings` Django decorator). This is done as a prep commit for #18641.
This commit is contained in:
@@ -187,7 +187,6 @@ from zerver.lib.utils import generate_api_key, log_statsd_event
|
||||
from zerver.lib.validator import check_widget_content
|
||||
from zerver.lib.widget import do_widget_post_save_actions, is_widget_message
|
||||
from zerver.models import (
|
||||
MAX_MESSAGE_LENGTH,
|
||||
Attachment,
|
||||
Client,
|
||||
CustomProfileField,
|
||||
@@ -3197,7 +3196,7 @@ def _internal_prep_message(
|
||||
Call do_send_messages with a list of the return values of this method.
|
||||
"""
|
||||
# Remove any null bytes from the content
|
||||
if len(content) > MAX_MESSAGE_LENGTH:
|
||||
if len(content) > settings.MAX_MESSAGE_LENGTH:
|
||||
content = content[0:3900] + "\n\n[message was too long and has been truncated]"
|
||||
|
||||
# If we have a stream name, and the stream doesn't exist, we
|
||||
|
||||
Reference in New Issue
Block a user