from django.core.management.base import BaseCommand
from nature.importer import import_observations_for_all_users


class Command(BaseCommand):
    help = "Import iNaturalist observations for all users with auto-import enabled"

    def handle(self, *args, **options):
        count = len(import_observations_for_all_users())
        self.stdout.write(f"Imported {count} observations")
