<reponame>kaizer88/emps
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-30 10:57
from __future__ import unicode_literals

from django.db import migrations

from django.contrib.auth.hashers import make_password

def create_api_user(apps, schema_editor):
    OperationsUser = apps.get_model("operations", "OperationsUser")
    user =  OperationsUser.objects.filter(username="elipsys_api_user").first()
    if not user:
    	OperationsUser.objects.create(username='elipsys_api_user',
                                      email='',
                                      password=make_password('<PASSWORD>?@'),
                                      is_superuser=False,
                                      is_staff=False)
    else:
        user.username='elipsys_api_user'
        user.email=''
        user.password=make_password('<PASSWORD>?@')
        user.is_superuser=False
        user.is_staff=False
        user.save()


class Migration(migrations.Migration):

    dependencies = [
        ('operations', '0007_auto_20180122_1319'),
    ]

    operations = [
    	migrations.RunPython(create_api_user),
    ]
