# Generated by Django 3.1.3 on 2021-10-04 19:45

from django.db import migrations


def change_list_to_dict_vendor_notes(apps, schema_editor):
    InvoiceModel = apps.get_model('vendor', 'Invoice')
    for invoice in InvoiceModel.objects.all():
        if isinstance(invoice.vendor_notes, list):
            temp_list = invoice.vendor_notes
            invoice.vendor_notes = {}
            invoice.vendor_notes['bugfix_migration_0027'] = temp_list
            invoice.save()


class Migration(migrations.Migration):

    dependencies = [
        ('vendor', '0026_auto_20210914_1209'),
    ]

    operations = [
        migrations.RunPython(change_list_to_dict_vendor_notes, reverse_code=migrations.RunPython.noop),
    ]
