# Generated by Django 5.2.8 on 2025-11-13 00:09

import django.core.validators
from django.db import migrations, models


def _fill_blank_ip(apps, schema_editor):
    LandingLead = apps.get_model("pages", "LandingLead")
    UserStory = apps.get_model("pages", "UserStory")

    LandingLead.objects.filter(ip_address__isnull=True).update(ip_address="")
    UserStory.objects.filter(ip_address__isnull=True).update(ip_address="")


def _noop(apps, schema_editor):
    return None


class Migration(migrations.Migration):

    dependencies = [
        ("pages", "0031_alter_application_options_and_more"),
    ]

    operations = [
        migrations.AlterField(
            model_name="landinglead",
            name="ip_address",
            field=models.CharField(
                blank=True,
                max_length=45,
                null=True,
                validators=[django.core.validators.validate_ipv46_address],
            ),
        ),
        migrations.AlterField(
            model_name="userstory",
            name="ip_address",
            field=models.CharField(
                blank=True,
                max_length=45,
                null=True,
                validators=[django.core.validators.validate_ipv46_address],
            ),
        ),
        migrations.RunPython(_fill_blank_ip, _noop),
        migrations.AlterField(
            model_name="landinglead",
            name="ip_address",
            field=models.CharField(
                blank=True,
                max_length=45,
                validators=[django.core.validators.validate_ipv46_address],
            ),
        ),
        migrations.AlterField(
            model_name="userstory",
            name="ip_address",
            field=models.CharField(
                blank=True,
                max_length=45,
                validators=[django.core.validators.validate_ipv46_address],
            ),
        ),
        migrations.RunPython(_fill_blank_ip, _noop),
    ]
