mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Fix populate_db pointer restore.
(imported from commit e7984f5a762fde833c3b8520ef556fbd841aacbb)
This commit is contained in:
parent
b14e4d2a57
commit
565acffbc5
@ -610,9 +610,10 @@ def restore_saved_messages():
|
||||
|
||||
# Set restored pointers to the very latest messages
|
||||
with transaction.commit_on_success():
|
||||
for up in UserProfile.objects.all():
|
||||
for user_profile in UserProfile.objects.all():
|
||||
try:
|
||||
top = UserMessage.objects.filter(user_profile_id=up.id).order_by("-message")[0]
|
||||
top = UserMessage.objects.filter(
|
||||
user_profile_id=user_profile.id).order_by("-message")[0]
|
||||
user_profile.pointer = top.message_id
|
||||
except IndexError:
|
||||
user_profile.pointer = -1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user