OpenSlides/server/openslides/assignments/migrations/0014_remove_deprecated_slides.py
FinnStutzenstein 2bcab5d098
Repository restructure
- moved all server related things into the folder `server`, so this
configuration is parallel to the client.
- All main "services" are now folders in the root directory
- Added Dockerfiles to each service (currently server and client)
- Added a docker compose configuration to start everything together.
Currently there are heavy dependencies into https://github.com/OpenSlides/openslides-docker-compose
- Resturctured the .gitignore. If someone needs something excluded,
please add it to the right section.
- Added initial build setup with Docker and docker-compose.
- removed setup.py. We won't deliver OpenSlides via pip anymore.
2020-08-21 08:11:13 +02:00

28 lines
807 B
Python

from django.db import migrations
def remove_deprecated_slides(apps, schema_editor):
Projector = apps.get_model("core", "Projector")
for projector in Projector.objects.all():
new_history = []
for entry in projector.elements_history:
new_entry = []
for subentry in entry:
if subentry["name"] != "assignments/poll":
new_entry.append(subentry)
if len(new_entry):
new_history.append(new_entry)
projector.elements_history = new_history
projector.save(skip_autoupdate=True)
class Migration(migrations.Migration):
dependencies = [
("assignments", "0013_rename_verbose_poll_types"),
]
operations = [
migrations.RunPython(remove_deprecated_slides),
]