# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-17 13:08
from __future__ import unicode_literals

from django.db import migrations
import enumfields.fields
import gdpr.enums


def set_legal_reason_state(apps, schema_editor):
    LegalReason = apps.get_model('gdpr', 'LegalReason')
    LegalReason.objects.filter(is_active=True).update(state=gdpr.enums.LegalReasonState.ACTIVE)
    LegalReason.objects.filter(is_active=False).update(state=gdpr.enums.LegalReasonState.EXPIRED)


class Migration(migrations.Migration):

    dependencies = [
        ('gdpr', '0007_migration'),
    ]

    operations = [
        migrations.RunPython(set_legal_reason_state),
    ]
