# coding=utf-8

from django.core.management import BaseCommand

from api.models import Diary


class Command(BaseCommand):
    def handle(self, *args, **options):
        for d in Diary.objects.all():
            if d.has_commented and d.rate_count < 1:
                d.rate_count = 1
                d.save()
