# Generated by Django 2.2.5 on 2019-09-26 23:07

from django.db import migrations


def generate_job_block_types(apps, schema_editor):
    User = apps.get_model("auth", "User")
    root = User.objects.filter(username="root").first()

    if not root:
        root = User.objects.create(username="root")

    DashBlockType = apps.get_model("dashblocks", "DashBlockType")

    DashBlockType.objects.get_or_create(
        name="Photos",
        slug="photos",
        description="Photos",
        has_title=True,
        has_image=True,
        has_rich_text=False,
        has_summary=False,
        has_link=False,
        has_gallery=False,
        has_color=False,
        has_video=False,
        has_tags=False,
        created_by_id=root.id,
        modified_by_id=root.id,
    )


class Migration(migrations.Migration):

    dependencies = [("jobs", "0004_auto_20170615_1455")]

    operations = [migrations.RunPython(generate_job_block_types)]

Add migration to add photo blocks type
Add migration to add photo blocks type
