'Render the course dates fragment.'

def render_to_fragment(self, request, course_id=None, **kwargs):

    course_key = CourseKey.from_string(course_id)
    course = get_course_with_access(request.user, 'load', course_key, check_if_enrolled=False)
    course_date_blocks = get_course_date_blocks(course, request.user)
    context = {'course_date_blocks': course_date_blocks}
    html = render_to_string('course_experience/course-dates-fragment.html', context)
    return Fragment(html)
