@@ -0,0 +1,681 @@
+# Generated by Django 2.0.2 on 2018-02-12 00:30%0A%0Afrom django.db import migrations%0A%0A%0Adef data_migration(apps, schema_editor):%0A    Officer = apps.get_model('api', 'Officer')%0A    fs = Officer.objects.filter(%0A        group__isnull=True,%0A        organization__isnull=False,%0A        organization__kind=30,%0A        organization__status__gt=0,%0A    )%0A    for f in fs:%0A        g = f.organization.groups.filter(%0A            kind=32%0A        ).latest('status')%0A        f.group = g%0A        f.save()%0A    return%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('api', '0074_auto_20180211_1356'),%0A    %5D%0A%0A    operations = %5B%0A        migrations.RunPython(data_migration),%0A    %5D%0A

patch officers