onboarding: Fix the query for 'greetings_message'.

The query to fetch one of the greetings message based on
content wasn't taking translation into account that would
result in a bug in realms using non-english language.

This commit updates the query to fix the bug.
This commit is contained in:
Prakhar Pratyush 2024-05-12 09:59:58 +05:30 committed by Tim Abbott
parent a799441fab
commit aad66674e7
1 changed files with 3 additions and 1 deletions

View File

@ -475,7 +475,9 @@ they can be disabled. [Learn more]({zulip_update_announcements_help_url}).
# This is a bit hacky, but works and is kinda a 1-off thing.
greetings_message = (
Message.objects.select_for_update()
.filter(id__in=message_ids, content__icontains="a great place to say “hi”")
.filter(
id__in=message_ids, content=remove_single_newlines(content1_of_greetings_topic_name)
)
.first()
)
assert greetings_message is not None