OpenSlides/server/openslides/assignments/migrations/0017_vote_to_y.py
Sean b5cb694fc7 Allow negative voting
Adds "no" as the opposite of "votes" as assignment poll method
Added global_yes, enabled new voting mode `N` in the server
Layout, Tables, Charts, Projector, Vote CSS, Cleanups, Percent bases,
analog votes and more
2020-11-24 23:14:12 +01:00

31 lines
742 B
Python

# Generated by Finn Stutzenstein on 2020-11-24 06:44
from django.db import migrations
def votes_to_y(apps, schema_editor):
AssignmentPoll = apps.get_model("assignments", "AssignmentPoll")
for poll in AssignmentPoll.objects.all():
changed = False
if poll.pollmethod == "votes":
poll.pollmethod = "Y"
changed = True
if poll.onehundred_percent_base == "votes":
poll.onehundred_percent_base = "Y"
changed = True
if changed:
poll.save(skip_autoupdate=True)
class Migration(migrations.Migration):
dependencies = [
("assignments", "0016_negative_votes"),
]
operations = [
migrations.RunPython(votes_to_y),
]