20 lines
502 B
Python
20 lines
502 B
Python
|
# Generated by Finn Stutzenstein on 2021-02-18 08:12
|
||
|
|
||
|
from django.db import migrations
|
||
|
|
||
|
|
||
|
def copy_read_groups_to_write_groups(apps, schema_editor):
|
||
|
ChatGroup = apps.get_model("chat", "ChatGroup")
|
||
|
|
||
|
for chatgroup in ChatGroup.objects.all():
|
||
|
chatgroup.write_groups.add(*chatgroup.read_groups.all())
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
("chat", "0002_new_access_groups_1"),
|
||
|
]
|
||
|
|
||
|
operations = [migrations.RunPython(copy_read_groups_to_write_groups)]
|