# Generated by Django 3.1.13 on 2021-08-06 08:40

from django.db import migrations
from django.db.models import Q


def update_values(apps, schema_editor):
    election = apps.get_model('vote', 'election')
    election.objects.update(result_published=Q(result_published=False))
    election.objects.update(enable_abstention=Q(enable_abstention=False))


class Migration(migrations.Migration):
    dependencies = [
        ('vote', '0028_auto_20210804_2335'),
    ]

    operations = [
        migrations.RenameField(
            model_name='election',
            old_name='result_unpublished',
            new_name='result_published',
        ),
        migrations.RenameField(
            model_name='election',
            old_name='disable_abstention',
            new_name='enable_abstention',
        ),
        migrations.RunPython(update_values, reverse_code=update_values),
    ]
