# Generated by Django 2.2.13 on 2020-11-17 00:02

from django.db import migrations, models
from django.utils.text import slugify


def set_slug_to_username(apps, schema_editor):
    users = apps.get_model("profiles", "User").objects.all()
    for user in users:
        user.slug = slugify(user.username)
        user.save()


def undo_slug(apps, schema_editor):
    # Slug will be deleted. Nothing needs to be done to undo
    pass


class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0005_auto_20201114_0323'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='slug',
            field=models.SlugField(default='', unique=False),
        ),
        migrations.RunPython(set_slug_to_username, undo_slug),
    ]

# Generated by Django 2.2.13 on 2020-11-17 00:02

from django.db import migrations, models
from django.utils.text import slugify


def set_slug_to_username(apps, schema_editor):
    users = apps.get_model("profiles", "User").objects.all()
    for user in users:
        user.slug = slugify(user.username)
        user.save()


def undo_slug(apps, schema_editor):
    # Slug will be deleted. Nothing needs to be done to undo
    pass


class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0005_auto_20201114_0323'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='slug',
            field=models.SlugField(default='', unique=False),
        ),
        migrations.RunPython(set_slug_to_username, undo_slug),
    ]

# Generated by Django 2.2.13 on 2020-11-17 00:02 # Slug will be deleted. Nothing needs to be done to undo