from datetime import time

from django.core.exceptions import ValidationError


def min_time_validator(value):
    """
    Custom validator to ensure time is greater than minimum allowed time.
    """
    min_allowed_time = time(hour=0, minute=1)
    if value <= min_allowed_time:
        raise ValidationError(
            f'Time must be after {min_allowed_time.strftime("%H:%M")}'
        )
