# Generated by ChatGPT on 2026-01-11

from django.db import migrations


def update_captrack_basic_access_permission(apps, schema_editor):
    Permission = apps.get_model("auth", "Permission")
    ContentType = apps.get_model("contenttypes", "ContentType")

    # Permission is attached to the ContentType of the model that defines it
    ct = ContentType.objects.get(app_label="captrack", model="captracksettings")

    Permission.objects.filter(content_type=ct, codename="basic_access").update(
        name="Can View Dashboard"
    )


class Migration(migrations.Migration):

    dependencies = [
        ("captrack", "0003_alter_captracksettings_options"),
        ("auth", "0012_alter_user_first_name_max_length"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.RunPython(update_captrack_basic_access_permission, migrations.RunPython.noop),
    ]
