mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
add_new_user_history: Fix ordering of created UserMessage rows.
This has no functional effect because user_message IDs aren't used, but will make the database cleaner.
This commit is contained in:
@@ -259,7 +259,7 @@ def add_new_user_history(user_profile, streams):
|
|||||||
if not stream.invite_only])
|
if not stream.invite_only])
|
||||||
recent_messages = Message.objects.filter(recipient_id__in=recipients,
|
recent_messages = Message.objects.filter(recipient_id__in=recipients,
|
||||||
pub_date__gt=one_week_ago).order_by("-id")
|
pub_date__gt=one_week_ago).order_by("-id")
|
||||||
message_ids_to_use = list(recent_messages.values_list('id', flat=True)[0:100])
|
message_ids_to_use = list(reversed(recent_messages.values_list('id', flat=True)[0:100]))
|
||||||
if len(message_ids_to_use) == 0:
|
if len(message_ids_to_use) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user