# coding=utf-8
# create by oldman at 17/3/22
from django.core.management import BaseCommand
from gm_types.doctor import DOCTOR_INFO_STATUS

from api.models import Doctor


class Command(BaseCommand):
    """
    修改医生的审核状态，有四个医生的资料修改状态是错误的先要修改过来
    python manage.py update_20170322_set_doctor_status
    """

    def handle(self, *args, **options):
        list_doctors = ['Drwangfengqi',
                        ]
        for item in list_doctors:
            try:
                doctor = Doctor.objects.get(id=item)
                doctor.status = DOCTOR_INFO_STATUS.CHECKED
                doctor.save()
                print doctor.id
            except Exception as e:
                print e.message
                continue

        print ('Done')
