# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-12 17:20
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations


def create_notificationsettings(apps, schema_editor):
    """Load state demonyms"""
    NotificationSetting = apps.get_model('notifications', 'NotificationSetting')
    User = apps.get_model('accounts', 'User')

    for user in User.objects.filter(is_staff=True):
        NotificationSetting.objects.get_or_create(user=user)


class Migration(migrations.Migration):

    dependencies = [
        ('notifications', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

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