Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
import_util: Use `get_markdown_link_for_url` to create attachment link.
PieterCK17d3e18e474a
diff --git a/zerver/data_import/import_util.py b/zerver/data_import/import_util.pyindex f593a2ae1a5..97ef67a2d60 100644--- a/zerver/data_import/import_util.py+++ b/zerver/data_import/import_util.py@@ -19,6 +19,7 @@ from django.utils.timezone import now as timezone_nowfrom zerver.data_import.sequencer import NEXT_IDfrom zerver.lib.avatar_hash import user_avatar_base_path_from_ids+from zerver.lib.markdown import get_markdown_link_for_urlfrom zerver.lib.message import normalize_body_for_importfrom zerver.lib.mime_types import INLINE_MIME_TYPES, bare_content_type, guess_extensionfrom zerver.lib.parallel import run_parallel@@ -902,7 +903,7 @@ def get_attachment_path_and_content(sanitize_name(filename),])- attachment_path = f"/user_uploads/{s3_path}"- content = f"[{link_name}]({attachment_path})"+ attachment_url = f"/user_uploads/{s3_path}"+ markdown_link = get_markdown_link_for_url(link_name, attachment_url)- return AttachmentLinkResult(path_id=s3_path, markdown_link=content)+ return AttachmentLinkResult(path_id=s3_path, markdown_link=markdown_link)