Skip to content
Snippets Groups Projects
Verified Commit e10a8206 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Ensure we delete existing actors to reset private and public keys

parent 9612b1ba
Branches
Tags
No related merge requests found
...@@ -7,6 +7,16 @@ import django.utils.timezone ...@@ -7,6 +7,16 @@ import django.utils.timezone
import uuid import uuid
def delete_system_actors(apps, schema_editor):
"""Revert site domain and name to default."""
Actor = apps.get_model("federation", "Actor")
Actor.objects.filter(preferred_username__in=['test', 'library']).delete()
def backward(apps, schema_editor):
pass
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
...@@ -14,6 +24,7 @@ class Migration(migrations.Migration): ...@@ -14,6 +24,7 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RunPython(delete_system_actors, backward),
migrations.CreateModel( migrations.CreateModel(
name='Follow', name='Follow',
fields=[ fields=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment