OpenSlides/server/openslides/chat/migrations/0003_new_access_groups_2.py
Finn Stutzenstein 4929e2b6f6 Change chat access groups
Adjust some client chat feature

- Cleanup some stuff
- Read and write chatting
2021-02-19 15:08:02 +01:00

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)]