# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-21 05:04
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import everyvoter_common.utils.models
import rendering.validators


def create_default_sending_address(apps, schema_editor):
    """Assign a default primary domain for each org"""
    SendingAddress = apps.get_model('mailer', 'SendingAddress')
    SendingAddress.objects.get_or_create(
        address=settings.DEFAULT_FROM_EMAIL, id=1)


class Migration(migrations.Migration):

    dependencies = [
        ('branding', '0001_initial'),
        ('mailer', '0003_foreign_relationships_blocks'),
    ]

    operations = [
        migrations.RunPython(create_default_sending_address, lambda x,y: None)
    ]
