# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-25 17:44
from __future__ import unicode_literals

from django.db import migrations


def populate_about_page(apps, schema_editor):
    from pages.models import IndexPage, TemplatePage
    home_page = IndexPage.objects.get(title='Our Revolution')
    about_page = TemplatePage(title='About', template='pages/about.html')
    home_page.add_child(instance=about_page)


def remove_about_page(apps, schema_editor):
    from pages.models import TemplatePage
    TemplatePage.objects.get(title='About').delete()


class Migration(migrations.Migration):

    dependencies = [
        ('pages', '0011_populate_news_posts'),
    ]

    operations = [
        migrations.RunPython(populate_about_page, reverse_code=remove_about_page)
    ]
