from django.contrib.auth.hashers import make_password
from django.db import migrations


def seed_adman(apps, schema_editor):
    User = apps.get_model("lyric", "User")
    User.objects.get_or_create(
        username="adman",
        defaults={
            "email": "adman@earthmanrpg.local",
            "password": make_password(None),
            "is_staff": False,
            "is_superuser": False,
            "searchable": False,
        },
    )


def reverse_noop(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    dependencies = [
        ("lyric", "0002_user_pronouns"),
    ]
    operations = [
        migrations.RunPython(seed_adman, reverse_noop),
    ]
