21 lines
574 B
Python
21 lines
574 B
Python
# Generated by Django 2.2.8 on 2020-01-08 21:04
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def existing_groups(apps, schema_editor):
|
|
Group = apps.get_model("auth", "Group")
|
|
KFetGroup = apps.get_model("kfetauth", "KFetGroup")
|
|
|
|
for group in Group.objects.filter(name__icontains="K-Fêt"):
|
|
kf_group = KFetGroup(group_ptr=group, pk=group.pk, name=group.name)
|
|
kf_group.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("kfetauth", "0002_kfetgroup_kfetpermission"),
|
|
]
|
|
|
|
operations = [migrations.RunPython(existing_groups)]
|