Commit 40cfdd2a authored by jaywink's avatar jaywink
Browse files

Fix 0041

parent e745e75a
Pipeline #5463 failed with stages
in 7 minutes and 17 seconds
......@@ -7,6 +7,7 @@ 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(
......@@ -24,10 +25,10 @@ def forward(apps, schema_editor):
content.author_id = profile.id
content.save()
# - Re-assign followers and following
followers = Profile.objects.filter(followers_id__in=profile.id)
followers = Profile.objects.filter(followers__in=profile.id)
for follower in followers:
profile.followers.add(follower)
following = Profile.objects.filter(following_id__in=profile.id)
following = Profile.objects.filter(following__in=profile.id)
for following in following:
profile.following.add(following)
# Store info
......
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