Rename bugdown.subject_links -> topic_links.

This commit is contained in:
Steve Howell 2018-11-01 18:07:27 +00:00 committed by Tim Abbott
parent 0e854288ee
commit 32232377f7
4 changed files with 5 additions and 5 deletions

View File

@ -3965,7 +3965,7 @@ def do_update_message(user_profile: UserProfile, message: Message, topic_name: O
# These fields have legacy field names.
event[ORIG_TOPIC] = orig_topic_name
event[TOPIC_NAME] = topic_name
event[TOPIC_LINKS] = bugdown.subject_links(message.sender.realm_id, topic_name)
event[TOPIC_LINKS] = bugdown.topic_links(message.sender.realm_id, topic_name)
edit_history_event[PREV_TOPIC] = orig_topic_name
if propagate_mode in ["change_later", "change_all"]:

View File

@ -1705,7 +1705,7 @@ def make_md_engine(realm_filters_key: int, email_gateway: bool) -> None:
realm=realm_filters_key,
code_block_processor_disabled=email_gateway)])
def subject_links(realm_filters_key: int, subject: str) -> List[str]:
def topic_links(realm_filters_key: int, subject: str) -> List[str]:
matches = [] # type: List[str]
realm_filters = realm_filters_for_realm(realm_filters_key)

View File

@ -330,7 +330,7 @@ class MessageDict:
recipient_type_id
)
obj['subject_links'] = bugdown.subject_links(sender_realm_id, subject)
obj['subject_links'] = bugdown.topic_links(sender_realm_id, subject)
if last_edit_time is not None:
obj['last_edit_timestamp'] = datetime_to_timestamp(last_edit_time)

View File

@ -738,7 +738,7 @@ class BugdownTest(ZulipTestCase):
content = "We should fix #224 and #115, but not issue#124 or #1124z or [trac #15](https://trac.zulip.net/ticket/16) today."
converted = bugdown.convert(content, message_realm=realm, message=msg)
converted_subject = bugdown.subject_links(realm.id, msg.subject)
converted_subject = bugdown.topic_links(realm.id, msg.subject)
self.assertEqual(converted, '<p>We should fix <a href="https://trac.zulip.net/ticket/224" target="_blank" title="https://trac.zulip.net/ticket/224">#224</a> and <a href="https://trac.zulip.net/ticket/115" target="_blank" title="https://trac.zulip.net/ticket/115">#115</a>, but not issue#124 or #1124z or <a href="https://trac.zulip.net/ticket/16" target="_blank" title="https://trac.zulip.net/ticket/16">trac #15</a> today.</p>')
self.assertEqual(converted_subject, [u'https://trac.zulip.net/ticket/444'])
@ -811,7 +811,7 @@ class BugdownTest(ZulipTestCase):
url_format_string=r"https://trac.zulip.net/ticket/%(id)s").save()
boring_msg = Message(sender=self.example_user('othello'),
subject=u"no match here")
converted_boring_subject = bugdown.subject_links(realm.id, boring_msg.subject)
converted_boring_subject = bugdown.topic_links(realm.id, boring_msg.subject)
self.assertEqual(converted_boring_subject, [])
def test_is_status_message(self) -> None: