def _is_suggestion_valid(thread_id, exploration_id):
 states = get_exploration_by_id(exploration_id).states
 suggestion = feedback_models.SuggestionModel.get_by_exploration_and_thread_id(exploration_id, thread_id)
 return (suggestion.state_name in states)

def _is_suggestion_valid ( thread_id , exploration_id ) : states = get_exploration_by_id ( exploration_id ) . states suggestion = feedback_models . SuggestionModel . get_by_exploration_and_thread_id ( exploration_id , thread_id ) return ( suggestion . state_name in states )
check if the suggestion is still valid .