# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-02-10 01:31
from __future__ import unicode_literals

from django.db import migrations


def copy_translatable_profile_fields(apps, schema_editor):
    OrganisationProfile = apps.get_model('profiles_v2', 'OrganisationProfile')
    OrganisationProfileTranslation = apps.get_model('profiles_v2', 'OrganisationProfileTranslation')
    for profile in OrganisationProfile.objects.all():
        OrganisationProfileTranslation.objects.create(
            master=profile,
            language_code='en',
            background_temp=profile.background
        )


class Migration(migrations.Migration):

    dependencies = [
        ('profiles_v2', '0008_auto_20170210_1538'),
    ]

    operations = [
        migrations.RunPython(copy_translatable_profile_fields),
    ]
