commit/galaxy-central: greg: Fix importing library datasets into multiple histories - library datasets will now only be imported into those checked.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/9ee23aa36ec3/ changeset: 9ee23aa36ec3 user: greg date: 2011-11-08 17:59:36 summary: Fix importing library datasets into multiple histories - library datasets will now only be imported into those checked. affected #: 3 files diff -r 542aa2dab591d6df036096547c6f615a2a412dce -r 9ee23aa36ec3807092ce1b8f3031ba751f1368e6 lib/galaxy/web/controllers/library_common.py --- a/lib/galaxy/web/controllers/library_common.py +++ b/lib/galaxy/web/controllers/library_common.py @@ -1855,7 +1855,7 @@ status=status ) @web.expose - def import_datasets_to_histories( self, trans, cntrller, library_id='', folder_id='', ldda_ids='', target_history_ids='', new_history_name='', **kwd ): + def import_datasets_to_histories( self, trans, cntrller, library_id='', folder_id='', ldda_ids='', target_history_id='', target_history_ids='', new_history_name='', **kwd ): # This method is called from one of the following places: # - a menu option for a library dataset ( ldda_ids is a single ldda id ) # - a menu option for a library folder ( folder_id has a value ) @@ -1870,7 +1870,6 @@ action = params.get( 'do_action', None ) user = trans.get_user() current_history = trans.get_history() - selected_history_id = params.get( 'selected_history_id', trans.security.encode_id( current_history.id ) ) if library_id: library = trans.sa_session.query( trans.model.Library ).get( trans.security.decode_id( library_id ) ) else: @@ -1882,9 +1881,11 @@ ldda_ids = util.listify( ldda_ids ) if ldda_ids: ldda_ids = map( trans.security.decode_id, ldda_ids ) - target_history_ids = util.listify( target_history_ids ) if target_history_ids: - target_history_ids = [ trans.security.decode_id( target_history_id ) for target_history_id in target_history_ids if target_history_id ] + target_history_ids = util.listify( target_history_ids ) + target_history_ids = set( [ trans.security.decode_id( target_history_id ) for target_history_id in target_history_ids if target_history_id ] ) + elif target_history_id: + target_history_ids = [ trans.security.decode_id( target_history_id ) ] if params.get( 'import_datasets_to_histories_button', False ): invalid_datasets = 0 if not ldda_ids or not ( target_history_ids or new_history_name ): @@ -1965,7 +1966,7 @@ library=library, current_history=current_history, ldda_ids=ldda_ids, - selected_history_id=selected_history_id, + target_history_id=target_history_id, target_history_ids=target_history_ids, source_lddas=source_lddas, target_histories=target_histories, diff -r 542aa2dab591d6df036096547c6f615a2a412dce -r 9ee23aa36ec3807092ce1b8f3031ba751f1368e6 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -236,7 +236,7 @@ template='/webapps/community/repository/grid.mako' default_sort_key = "Repository.name" columns = [ - NameColumn( "Name", + NameColumn( "Repository name", link=( lambda item: dict( operation="view_or_manage_repository", id=item.id, webapp="community" ) ), @@ -588,17 +588,17 @@ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) else: ok = False - if workflow_names: + elif workflow_names: if 'workflows' in metadata: workflows = metadata[ 'workflows' ] else: workflows = [] for workflow_dict in workflows: for workflow_name in workflow_names: - if self.__in_workflow_dict( workflow_dict, exact_matches_checked, workflow_name=workflow_name ): + if self.__in_workflow_dict( workflow_dict, exact_matches_checked, workflow_name ): match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) ) return ok, match_tuples - def __in_workflow_dict( self, workflow_dict, exact_matches_checked, workflow_name=None ): + def __in_workflow_dict( self, workflow_dict, exact_matches_checked, workflow_name ): workflow_dict_workflow_name = workflow_dict[ 'name' ].lower() return ( workflow_name == workflow_dict_workflow_name ) or \ ( not exact_matches_checked and workflow_dict_workflow_name.find( workflow_name ) >= 0 ) diff -r 542aa2dab591d6df036096547c6f615a2a412dce -r 9ee23aa36ec3807092ce1b8f3031ba751f1368e6 templates/library/common/import_datasets_to_histories.mako --- a/templates/library/common/import_datasets_to_histories.mako +++ b/templates/library/common/import_datasets_to_histories.mako @@ -49,12 +49,12 @@ <div class="toolFormTitle">Destination Histories:</div><div class="toolFormBody"><div class="form-row" id="single-destination"> - <select id="single-dest-select" name="target_history_ids"> + <select id="single-dest-select" name="target_history_id"> %for i, target_history in enumerate( target_histories ): <% encoded_id = trans.security.encode_id( target_history.id ) - if encoded_id == selected_history_id: - selected_text = " selected" + if encoded_id == target_history_id: + selected_text = " selected='selected'" else: selected_text = "" if target_history == current_history: Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket