# Generated by Django 5.1.7 on 2025-11-04 12:50

import swapper

from django.contrib.auth import get_user_model
from django.db import migrations


def delete_dlr_settings(apps, schema_editor):
    ProjectModelSettings = swapper.load_model("django_project_base", "ProjectSettings")
    ProjectModelSettings._base_manager.filter(
        name__in=[
            "aws-sns-sms-dlr-user",
            "aws-sns-sms-dlr-password",
            "aws-ses-email-dlr-user",
            "aws-ses-email-dlr-password",
            "nexmo-sms-dlr-user",
            "nexmo-sms-dlr-password",
            "t2-sms-dlr-user",
            "t2-sms-dlr-password",
        ]
    ).delete()

    get_user_model().objects.filter(
        username__istartswith="t2-", username__iendswith="-username", email="klemen.spruk@velis.si"
    ).update(email="t2-sms_dlr@velis.si")


class Migration(migrations.Migration):
    dependencies = [
        ("notifications", "0012_djangoprojectbasenotification_done_and_more"),
    ]

    operations = [
        migrations.RunPython(delete_dlr_settings),
    ]
