# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-11-02 19:42
from __future__ import unicode_literals

from django.db import migrations


def set_store_tp_path(apps, schema_editor):
    stores = apps.get_model("pootle_store.Store").objects.all()
    for store in stores:
        parts = store.pootle_path.lstrip("/").split("/")
        store.tp_path = '/'.join([""] + parts[2:])
        store.save()


class Migration(migrations.Migration):

    dependencies = [
        ('pootle_store', '0020_store_tp_path'),
    ]

    operations = [
        migrations.RunPython(set_store_tp_path),
    ]
