# Generated by Django 2.2.7 on 2019-11-26 09:42

import django.contrib.postgres.fields
from django.db import migrations, models
from django.db.models import F


def fill_default_scopes(apps, schema_editor):
    Application = apps.get_model("authent", "Application")
    Application.objects.filter(users_allowed_scopes=None).update(
        users_allowed_scopes=F("scopes")
    )


class Migration(migrations.Migration):

    dependencies = [
        ("authent", "0005_pre_add_scope_restrictions_for_application_users"),
    ]

    operations = [
        migrations.RunPython(fill_default_scopes, migrations.RunPython.noop),
        migrations.AlterField(
            model_name="application",
            name="users_allowed_scopes",
            field=django.contrib.postgres.fields.ArrayField(
                base_field=models.CharField(max_length=32),
                default=list,
                help_text="User's allowed scopes (separated with commas)",
                size=None,
            ),
        ),
    ]
