def get_accepted_answer(question):
    """
    Returns the accepted answer from a question object
    :param question: a question object
    :return: the accepted answer object or none if there weren't any
    """
    answers = question.answers
    for a in answers:
        if a.accepted:
            return a
    return None