details: http://www.bx.psu.edu/hg/galaxy/rev/93474ea5c366 changeset: 3145:93474ea5c366 user: rc date: Thu Dec 03 16:16:12 2009 -0500 description: Requests in any state can be deleted by an admin
diffstat:
lib/galaxy/web/controllers/requests.py | 2 +- lib/galaxy/web/controllers/requests_admin.py | 22 ++++++---------------- 2 files changed, 7 insertions(+), 17 deletions(-)
diffs (58 lines):
diff -r 29b6fac01d78 -r 93474ea5c366 lib/galaxy/web/controllers/requests.py --- a/lib/galaxy/web/controllers/requests.py Thu Dec 03 15:33:15 2009 -0500 +++ b/lib/galaxy/web/controllers/requests.py Thu Dec 03 16:16:12 2009 -0500 @@ -542,7 +542,7 @@ action='new', **kwd) ) request = self.__save_request(trans, None, **kwd) - msg = 'The new request named %s has been created' % request.name + msg = 'The new request named <b>%s</b> has been created' % request.name if params.get('create_request_button', False) == 'Save': return trans.response.send_redirect( web.url_for( controller='requests', action='list', diff -r 29b6fac01d78 -r 93474ea5c366 lib/galaxy/web/controllers/requests_admin.py --- a/lib/galaxy/web/controllers/requests_admin.py Thu Dec 03 15:33:15 2009 -0500 +++ b/lib/galaxy/web/controllers/requests_admin.py Thu Dec 03 16:16:12 2009 -0500 @@ -149,7 +149,7 @@ confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." ), grids.GridOperation( "Edit", allow_multiple=False, condition=( lambda item: not item.deleted ) ), grids.GridOperation( "Reject", allow_multiple=False, condition=( lambda item: not item.deleted and item.submitted() ) ), - grids.GridOperation( "Delete", allow_multiple=True, condition=( lambda item: not item.deleted and item.new() ) ), + grids.GridOperation( "Delete", allow_multiple=True, condition=( lambda item: not item.deleted ) ), grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ) ), ] global_actions = [ @@ -387,7 +387,6 @@ return self.__show_request_form(trans) def __delete_request(self, trans, **kwd): id_list = util.listify( kwd['id'] ) - delete_failed = [] for id in id_list: try: request = trans.sa_session.query( trans.app.model.Request ).get( trans.security.decode_id(id) ) @@ -399,20 +398,11 @@ status='error', message=msg, **kwd) ) - # a request cannot be deleted once its submitted - if not request.new(): - delete_failed.append(request.name) - else: - request.deleted = True - trans.sa_session.add( request ) - trans.sa_session.flush() - if not len(delete_failed): - msg = '%i request(s) has been deleted.' % len(id_list) - status = 'done' - else: - msg = '%i request(s) has been deleted. %i request %s could not be deleted as they have been submitted.' % (len(id_list)-len(delete_failed), - len(delete_failed), str(delete_failed)) - status = 'warning' + request.deleted = True + trans.sa_session.add( request ) + trans.sa_session.flush() + msg = '%i request(s) has been deleted.' % len(id_list) + status = 'done' return trans.response.send_redirect( web.url_for( controller='requests_admin', action='list', status=status,
galaxy-dev@lists.galaxyproject.org