Commit 3491c712 authored by jaywink's avatar jaywink
Browse files

Make 0041 migration noop

It's already been run on a server and I'm too lazy to revert it, so noop it instead.
parent 48d60755
......@@ -4,43 +4,6 @@ from django.db import migrations
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(
if not dupes:
# If dupes found
# There should only be one dupe, since we've only 2 protocols
dupe = dupes[0]
# - Re-assign all content
for content in Content.objects.filter(
content.author_id =
# - Re-assign followers and following
for follower in dupe.followers.all():
for following in dupe.following.all():
# Store info
guid = dupe.guid
handle = dupe.handle
# - Delete the dupe
# - Set guid and handle, if missing
if not profile.guid and guid:
profile.giod = guid
if not profile.handle and handle:
profile.handle = handle
class Migration(migrations.Migration):
dependencies = [
......@@ -48,5 +11,5 @@ class Migration(migrations.Migration):
operations = [
RunPython(forward, RunPython.noop)
RunPython(RunPython.noop, RunPython.noop)
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