b5cb694fc7
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
31 lines
742 B
Python
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),
|
|
]
|