mirror of https://github.com/zulip/zulip.git
refactor: Rename remaining bugdown_convert to markdown_convert.
This commit is part of series of commits aimed at renaming bugdown to markdown.
This commit is contained in:
parent
bbec1f72a8
commit
66d54d86ad
|
@ -4,15 +4,15 @@ from zerver.lib.cache import (
|
||||||
realm_text_description_cache_key,
|
realm_text_description_cache_key,
|
||||||
)
|
)
|
||||||
from zerver.lib.html_to_text import html_to_text
|
from zerver.lib.html_to_text import html_to_text
|
||||||
from zerver.lib.markdown import convert as bugdown_convert
|
from zerver.lib.markdown import convert as markdown_convert
|
||||||
from zerver.models import Realm
|
from zerver.models import Realm
|
||||||
|
|
||||||
|
|
||||||
@cache_with_key(realm_rendered_description_cache_key, timeout=3600*24*7)
|
@cache_with_key(realm_rendered_description_cache_key, timeout=3600*24*7)
|
||||||
def get_realm_rendered_description(realm: Realm) -> str:
|
def get_realm_rendered_description(realm: Realm) -> str:
|
||||||
realm_description_raw = realm.description or "The coolest place in the universe."
|
realm_description_raw = realm.description or "The coolest place in the universe."
|
||||||
return bugdown_convert(realm_description_raw, message_realm=realm,
|
return markdown_convert(realm_description_raw, message_realm=realm,
|
||||||
no_previews=True)
|
no_previews=True)
|
||||||
|
|
||||||
@cache_with_key(realm_text_description_cache_key, timeout=3600*24*7)
|
@cache_with_key(realm_text_description_cache_key, timeout=3600*24*7)
|
||||||
def get_realm_text_description(realm: Realm) -> str:
|
def get_realm_text_description(realm: Realm) -> str:
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.conf import settings
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from zerver.lib.markdown import convert as bugdown_convert
|
from zerver.lib.markdown import convert as markdown_convert
|
||||||
from zerver.lib.request import JsonableError
|
from zerver.lib.request import JsonableError
|
||||||
from zerver.models import (
|
from zerver.models import (
|
||||||
DefaultStreamGroup,
|
DefaultStreamGroup,
|
||||||
|
@ -45,7 +45,7 @@ def get_default_value_for_history_public_to_subscribers(
|
||||||
return history_public_to_subscribers
|
return history_public_to_subscribers
|
||||||
|
|
||||||
def render_stream_description(text: str) -> str:
|
def render_stream_description(text: str) -> str:
|
||||||
return bugdown_convert(text, no_previews=True)
|
return markdown_convert(text, no_previews=True)
|
||||||
|
|
||||||
def send_stream_creation_event(stream: Stream, user_ids: List[int]) -> None:
|
def send_stream_creation_event(stream: Stream, user_ids: List[int]) -> None:
|
||||||
event = dict(type="stream", op="create",
|
event = dict(type="stream", op="create",
|
||||||
|
|
|
@ -10,7 +10,7 @@ from zerver.lib.actions import (
|
||||||
try_reorder_realm_custom_profile_fields,
|
try_reorder_realm_custom_profile_fields,
|
||||||
)
|
)
|
||||||
from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS
|
from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS
|
||||||
from zerver.lib.markdown import convert as bugdown_convert
|
from zerver.lib.markdown import convert as markdown_convert
|
||||||
from zerver.lib.test_classes import ZulipTestCase
|
from zerver.lib.test_classes import ZulipTestCase
|
||||||
from zerver.lib.test_helpers import queries_captured
|
from zerver.lib.test_helpers import queries_captured
|
||||||
from zerver.models import (
|
from zerver.models import (
|
||||||
|
@ -536,7 +536,7 @@ class UpdateCustomProfileFieldTest(CustomProfileFieldTestCase):
|
||||||
expected_rendered_value: Dict[Union[int, float, str, None], Union[str, None]] = {}
|
expected_rendered_value: Dict[Union[int, float, str, None], Union[str, None]] = {}
|
||||||
for f in data:
|
for f in data:
|
||||||
if f['field'].is_renderable():
|
if f['field'].is_renderable():
|
||||||
expected_rendered_value[f['id']] = bugdown_convert(f['value'])
|
expected_rendered_value[f['id']] = markdown_convert(f['value'])
|
||||||
else:
|
else:
|
||||||
expected_rendered_value[f['id']] = None
|
expected_rendered_value[f['id']] = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue