populate_db: Remove use of deleted pointer field.

Apparently, when we removed the pointer from our data model, we
neglected to delete this update code from populate_db.
This commit is contained in:
sophie200 2020-12-28 22:18:25 -06:00 committed by Tim Abbott
parent 1489c24860
commit fae2265e5d
1 changed files with 1 additions and 14 deletions

View File

@ -12,7 +12,7 @@ from django.contrib.sessions.models import Session
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandParser
from django.db import connection
from django.db.models import F, Max
from django.db.models import F
from django.utils.timezone import now as timezone_now
from django.utils.timezone import timedelta as timezone_timedelta
@ -850,19 +850,6 @@ class Command(BaseCommand):
# Now subscribe everyone to these streams
subscribe_users_to_streams(zulip_realm, zulip_stream_dict)
if not options["test_suite"]:
# Update pointer of each user to point to the last message in their
# UserMessage rows with sender_id=user_profile_id.
users = list(
UserMessage.objects.filter(message__sender_id=F("user_profile_id"))
.values("user_profile_id")
.annotate(pointer=Max("message_id"))
)
for user in users:
UserProfile.objects.filter(id=user["user_profile_id"]).update(
pointer=user["pointer"]
)
create_user_groups()
if not options["test_suite"]: