# Generated by Django 3.1 on 2020-08-12 12:13

from django.db import migrations


def init_auth_group(apps, schema_editor):
    AuthGroup = apps.get_model('auth', 'Group')
    User = apps.get_model('user', 'User')

    try:
        AuthGroup.objects.get(name='no_score')
    except AuthGroup.DoesNotExist:
        no_score = AuthGroup.objects.create(name='no_score')
        for user in User.objects.all():
            if user.is_superuser:
                user.groups.add(no_score)

    try:
        AuthGroup.objects.get(name='banned')
    except AuthGroup.DoesNotExist:
        AuthGroup.objects.create(name='banned')


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0001_initial'),
        ('auth', '0012_alter_user_first_name_max_length')
    ]

    operations = [
        migrations.RunPython(init_auth_group),
    ]

# Generated by Django 3.1 on 2020-08-12 12:13

from django.db import migrations


def init_auth_group(apps, schema_editor):
    AuthGroup = apps.get_model('auth', 'Group')
    User = apps.get_model('user', 'User')

    try:
        AuthGroup.objects.get(name='no_score')
    except AuthGroup.DoesNotExist:
        no_score = AuthGroup.objects.create(name='no_score')
        for user in User.objects.all():
            if user.is_superuser:
                user.groups.add(no_score)

    try:
        AuthGroup.objects.get(name='banned')
    except AuthGroup.DoesNotExist:
        AuthGroup.objects.create(name='banned')


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0001_initial'),
        ('auth', '0012_alter_user_first_name_max_length')
    ]

    operations = [
        migrations.RunPython(init_auth_group),
    ]

# Generated by Django 3.1 on 2020-08-12 12:13