# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-12-19 11:53
from __future__ import unicode_literals

from django.db import migrations, models
from organization.network.models import Team


def generate_slugs(apps, schema_editor):
    teams = Team.objects.all()
    for team in teams:
        team.save()


class Migration(migrations.Migration):

    dependencies = [
        ('organization-network', '0117_merge_20181204_1801'),
    ]

    operations = [
        migrations.AddField(
            model_name='team',
            name='slug',
            field=models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the name.', max_length=2000, null=True, verbose_name='URL'),
        ),
        migrations.RunPython(generate_slugs),
    ]

@@ -195,16 +195,18 @@
  Team%0A%0A%0A
+# 
 def gene
@@ -238,16 +238,18 @@
 ditor):%0A
+# 
     team
@@ -271,16 +271,18 @@
 s.all()%0A
+# 
     for 
@@ -296,16 +296,18 @@
  teams:%0A
+# 
         
@@ -731,32 +731,34 @@
       ),%0A       
+ #
  migrations.RunP

Fix migration when no existing team.user field at fresh start