diff --git a/lib/galaxy/web/controllers/history.py b/lib/galaxy/web/controllers/history.py index cf12e3fe6ae..001daef235d 100644 --- a/lib/galaxy/web/controllers/history.py +++ b/lib/galaxy/web/controllers/history.py @@ -196,6 +196,22 @@ class HistoryController( BaseController ): return self.rename( trans, **kwargs ) return self._list_grid( trans, *args, **kwargs ) + @web.expose + def delete_current( self, trans ): + """ + Delete just the active history -- this does not require a logged + in user. + """ + history = trans.get_history() + if not history.deleted: + history.deleted = True + history.flush() + trans.log_event( "History id %d marked as deleted" % history.id ) + # Regardless of whether it was previously deleted, we make a new + # history active + trans.new_history() + return trans.show_ok_message( "History deleted, a new history is active" ) + @web.expose def rename_async( self, trans, id=None, new_name=None ): history = model.History.get( id ) diff --git a/templates/history/options.mako b/templates/history/options.mako index b9f3c460d46..eb3813eeae9 100644 --- a/templates/history/options.mako +++ b/templates/history/options.mako @@ -22,5 +22,5 @@