'Rate a history asynchronously and return updated community data.'

@web.expose
@web.require_login('rate    items')
@web.json
def rate_async(self, trans, id, rating):

    history = self.history_manager.get_accessible(self.decode_id(id), trans.user, current_history=trans.history)
    if (not history):
        return trans.show_error_message('The    specified    history    does    not    exist.')
    self.rate_item(trans.sa_session, trans.get_user(), history, rating)
    return self.get_ave_item_rating_data(trans.sa_session, history)
