# Generated 2026-05-27 — seed the @mailman system user (author of the
# "Acceptances & rejections" my-sea invite log Lines). Mirrors
# `0014`'s seed_taxman / `0003_seed_adman`. Pairs w. `billboard/0009_
# mail_acceptance_kind` for the new Post/Brief kind registration.

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


def seed_mailman(apps, schema_editor):
    """Mirror `0003_seed_adman` for the @mailman system user — authors the
    interactive OK/BYE invite log Lines per [[my-sea-invite-voice-blueprint]]."""
    User = apps.get_model("lyric", "User")
    User.objects.get_or_create(
        username="mailman",
        defaults={
            "email": "mailman@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", "0014_brief_dismissal_fields"),
    ]

    operations = [
        migrations.RunPython(seed_mailman, reverse_noop),
    ]
