# Generated by Django 2.1.7 on 2019-04-17 18:57

from django.db import migrations


def reduce_translations(apps, schema_editor):
    Carrier = apps.get_model("tieredweightzone", "Carrier")
    for carrier in Carrier.objects.all():
        translation = carrier.translations.first()
        carrier.name = translation.name
        carrier.description = translation.description
        carrier.method = translation.method
        carrier.delivery = translation.delivery
        carrier.save()

    Zone = apps.get_model("tieredweightzone", "Zone")
    for zone in Zone.objects.all():
        translation = zone.translations.first()
        zone.name = translation.name
        zone.description = translation.description
        zone.save()


class Migration(migrations.Migration):

    dependencies = [("tieredweightzone", "0002_auto_20190417_1857")]

    operations = [migrations.RunPython(reduce_translations)]
