# Generated by Django 3.2.6 on 2021-10-12 20:47

from django.db import migrations

def load_user (apps, schema_editor):
    User = apps.get_model ('auth', 'User')
    user_admin = User (password='admin', is_superuser=1, username='admin', first_name = 'Admin', last_name = 'Admin', email='admin@gmail.com',
                       is_staff=1, is_active=1, date_joined='2021-09-08 15:37:32.013943')
    user_admin.save()
    user_guest = User(password='guest', is_superuser=0, username='guest', first_name='Guest', last_name='Guest',
                      email='guest@gmail.com',
                      is_staff=0, is_active=1, date_joined='2021-09-08 15:37:32.013943')
    user_guest.save()
    user_organisation = User(password='organisation', is_superuser=0, username='organisation', first_name='Organisation', last_name='Organisation',
                      email='organisation@gmail.com',
                      is_staff=0, is_active=1, date_joined='2021-09-08 15:37:32.013943')
    user_organisation.save()


def delete_user(apps, schema_editor):
    User = apps.get_model("auth", "User")
    User.objects.all().delete()

class Migration(migrations.Migration):

    dependencies = [
        ('registration', '0008_workarea_migration'),
    ]

    operations = [
        migrations.RunPython(load_user, delete_user),
    ]
