Commit 060f10d3 authored by jaywink's avatar jaywink
Browse files

Fix 0041

parent 40cfdd2a
Pipeline #5464 failed with stages
in 16 minutes and 39 seconds
......@@ -7,7 +7,6 @@ from django.db.migrations import RunPython
def forward(apps, schema_editor):
# noinspection PyPep8Naming
Profile = apps.get_model("users", "Profile")
Content = apps.get_model("content", "Content")
for profile in Profile.objects.filter(user__isnull=True, protocol="activitypub").iterator():
dupes = Profile.objects.filter(
......@@ -25,11 +24,9 @@ def forward(apps, schema_editor):
content.author_id = profile.id
content.save()
# - Re-assign followers and following
followers = Profile.objects.filter(followers__in=profile.id)
for follower in followers:
for follower in dupe.followers.all():
profile.followers.add(follower)
following = Profile.objects.filter(following__in=profile.id)
for following in following:
for following in dupe.following.all():
profile.following.add(following)
# Store info
guid = dupe.guid
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment