from django.core.management.base import (
    BaseCommand,
    CommandError,
)
from staff.person.models import StaffCar
from ._reset_position import reset_all_position


class Command(BaseCommand):
    help = 'Переустанавливает position у всех автомобилей в StaffCar'

    def handle(self, *args, **options):
        try:
            reset_all_position(StaffCar)
        except Exception as e:
            raise CommandError(e)
