"""Creates the company's own internal customer (specification 4, K39).""" from django.db import migrations def create_internal_customer(apps, schema_editor): customer = apps.get_model("customers", "CustomerModel") if not customer.objects.filter(is_internal=True).exists(): customer.objects.create(name="Oma yritys (sisäinen)", type="company", is_internal=True) class Migration(migrations.Migration): dependencies = [("customers", "0001_initial")] operations = [migrations.RunPython(create_internal_customer, migrations.RunPython.noop)]