mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-29 17:42:12 +08:00
Fix for deleting histories when not logged in
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
<li><a href="${h.url_for( action='history_set_default_permissions' )}">Change default permissions</a> for the current history</li>
|
||||
%endif
|
||||
<li><a href="${h.url_for( controller='root', action='history', show_deleted=True)}" target="galaxy_history">Show deleted</a> datasets in history</li>
|
||||
<li><a href="${h.url_for( controller='history', action='list', operation="delete", id=history.id )}" confirm="Are you sure you want to delete the current history?">Delete</a> current history</div>
|
||||
<li><a href="${h.url_for( controller='history', action='delete_current' )}" confirm="Are you sure you want to delete the current history?">Delete</a> current history</div>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user