# Generated by Django 3.0.9 on 2020-09-12 15:04

from django.db import migrations
from edc_constants.constants import NO, UNKNOWN


def update_complications_unknown_to_no(apps, schema_editor):
    complications_baseline_model_cls = apps.get_model("inte_subject.complicationsbaseline")
    names = [
        "stroke",
        "heart_attack",
        "renal_disease",
        "vision",
        "numbness",
        "foot_ulcers",
    ]
    for name in names:
        complications_baseline_model_cls.objects.filter(**{name: UNKNOWN}).update(**{name: NO})


class Migration(migrations.Migration):

    dependencies = [
        ("inte_subject", "0056_auto_20200912_1756"),
    ]

    operations = [migrations.RunPython(update_complications_unknown_to_no)]
