# Generated by Django 5.2.13 on 2026-04-19 21:56

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("authentik_flows", "0031_alter_flow_layout"),
    ]

    operations = [
        migrations.CreateModel(
            name="AccountLockdownStage",
            fields=[
                (
                    "stage_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="authentik_flows.stage",
                    ),
                ),
                (
                    "deactivate_user",
                    models.BooleanField(
                        default=True,
                        help_text="Deactivate the user account (set is_active to False)",
                    ),
                ),
                (
                    "set_unusable_password",
                    models.BooleanField(
                        default=True, help_text="Set an unusable password for the user"
                    ),
                ),
                (
                    "delete_sessions",
                    models.BooleanField(
                        default=True, help_text="Delete all active sessions for the user"
                    ),
                ),
                (
                    "revoke_tokens",
                    models.BooleanField(
                        default=True,
                        help_text="Revoke all tokens for the user (API, app password, recovery, verification, OAuth)",
                    ),
                ),
                (
                    "self_service_completion_flow",
                    models.ForeignKey(
                        blank=True,
                        help_text="Flow to redirect users to after self-service lockdown. This flow should not require authentication since the user's session is deleted.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="account_lockdown_stages",
                        to="authentik_flows.flow",
                    ),
                ),
            ],
            options={
                "verbose_name": "Account Lockdown Stage",
                "verbose_name_plural": "Account Lockdown Stages",
            },
            bases=("authentik_flows.stage",),
        ),
    ]
