create_user: Use silent mentions in user join notices.

This provides more information (email, etc.) when clicked on
while being better adapted to email_address_visibility existing.

Fixes #27243.
This commit is contained in:
Sayyed Arib Hussain
2023-10-24 22:28:55 +05:30
committed by GitHub
parent 56ccaa571e
commit 7e38d06130
3 changed files with 3 additions and 3 deletions

View File

@@ -254,7 +254,7 @@ def process_new_human_user(
get_system_bot(settings.NOTIFICATION_BOT, prereg_user.referred_by.realm_id),
prereg_user.referred_by,
_("{user} accepted your invitation to join Zulip!").format(
user=f"{user_profile.full_name} <`{user_profile.email}`>"
user=silent_mention_syntax_for_user(user_profile)
),
)

View File

@@ -957,7 +957,7 @@ class InviteUserTest(InviteUserBase):
self.assertEqual(inviter_msg.sender.email, "notification-bot@zulip.com")
self.assertTrue(
inviter_msg.content.startswith(
f"alice_zulip.com <`{invitee_profile.email}`> accepted your",
f"@_**{invitee_profile.full_name}|{invitee_profile.id}** accepted your",
)
)

View File

@@ -826,7 +826,7 @@ class QueryCountTest(ZulipTestCase):
prereg_user = PreregistrationUser.objects.get(email="fred@zulip.com")
with self.assert_database_query_count(92):
with self.assert_database_query_count(93):
with self.assert_memcached_count(23):
with self.capture_send_event_calls(expected_num_events=11) as events:
fred = do_create_user(