# Generated by Django 4.2.9 on 2024-11-10 21:25

from django.db import migrations


def strip_place_aliases(apps, schema_editor):
    Place = apps.get_model("agenda_culturel", "Place")

    places = Place.objects.all()

    for p in places:
        if not p.aliases is None:
            p.aliases = [a.strip() for a in p.aliases]

    Place.objects.bulk_update(places, fields=["aliases"])

    

def do_nothing(apps, schema_editor):
    pass

class Migration(migrations.Migration):

    dependencies = [
        ('agenda_culturel', '0106_alter_event_other_versions'),
    ]

    operations = [
        migrations.RunPython(strip_place_aliases, reverse_code=do_nothing)
    ]
