'Clears the history for a user.'

@web.expose
def clear_history(self, trans):

    history = trans.get_history()
    for dataset in history.datasets:
        dataset.deleted = True
        dataset.clear_associated_files()
    trans.sa_session.flush()
    trans.log_event(('History    id    %s    cleared' % str(history.id)))
    trans.response.send_redirect(web.url_for('/index'))
