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:
Tim Abbott
2016-11-10 20:37:43 -08:00
parent 08ca209aed
commit 3b145b2370

View File

@@ -259,7 +259,7 @@ def add_new_user_history(user_profile, streams):
if not stream.invite_only])
recent_messages = Message.objects.filter(recipient_id__in=recipients,
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:
return