streams: Disable inline URL preview when rendering stream descriptions.

We want to use the baseline features of bugdown, but not fancy things
like inline URL previews, since the whole structure of stream
descriptions is to have a single-line thing supporting some
formatting.

The migration part of this change fixes a bug encountered by some
organizations upgrading from older versions of Zulip.
This commit is contained in:
Tim Abbott
2019-02-28 17:00:40 -08:00
parent d6c09eac51
commit de65a04ae0
5 changed files with 17 additions and 5 deletions

View File

@@ -1751,7 +1751,7 @@ def create_stream_if_needed(realm: Realm,
)
if created:
stream.rendered_description = bugdown_convert(stream.description)
stream.rendered_description = bugdown_convert(stream.description, no_previews=True)
stream.save(update_fields=["rendered_description"])
Recipient.objects.create(type_id=stream.id, type=Recipient.STREAM)
if stream.is_public():
@@ -3505,7 +3505,7 @@ def do_rename_stream(stream: Stream,
def do_change_stream_description(stream: Stream, new_description: str) -> None:
stream.description = new_description
stream.rendered_description = bugdown_convert(new_description)
stream.rendered_description = bugdown_convert(new_description, no_previews=True)
stream.save(update_fields=['description', 'rendered_description'])
event = dict(