def METHOD_NAME(certificate_page, max_date):
    """Get the latest certificate page revision created till max_date"""
    return (
        certificate_page.revisions.filter(created_at__lte=max_date)
        .order_by("-created_at")
        .first()
    )