1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/6a84a0a756b2/ changeset: r4999:6a84a0a756b2 user: greg date: 2011-02-04 22:16:00 summary: Data library fixes and improvements: 1. Fix a bug that included the option for a regular user to upload a directory of files when the config setting existed, but the user's directory did not exist. ¬†Instead of throwing an exception, an attempt to create the directory will now be done. ¬†If the attempt fails, the option to "Upload a directory of files" will not be included in the select list on the upload form. 2. When browsing a data library, only display the check boxes and the actions to perform on multiple selected datasets if library datasets are displayed. 3. Clean up the behavior when performing an action on multiple library datasets. ¬†Instead of throwing an error and not allowing the action on any of the datasets if the user is not authorized to perform the action on 1 of them, all "unauthorized" datasets are now left alone and the action is performed on all datasets for which the user is authorized to perform the action. ¬†Appropriate messages detail what occurred. 4. Allow regular users to delete multiple datasets returned from library dataset searches based on the behavior described in 3 above. 5. Do not include the "Select datasets for import into selected histories" option in the actions pop-up menu at the data library level if the library's root folder doesn't contain any accessible datasets. ¬†Make behavior the same for folder popup menus. 6. ¬†Add a new LibraryFolder.active_datasets mapper and eliminate the incorrect¬†LibraryFolder.active_library_datasets property. ¬†Callers of the incorrect property now use the mapper. 7. Eliminate the incorrect LibraryFolder.active_datasets property. 8. Fix the queries in the library_common controller's active_folders_and_lddas() and activable_folders_and_lddas() methods to return library_datasets instead of lddas, and rename the methods to be active_folders_and_library_datasets(0 and activatable_folders_and_library_datasets() respectively. 9. Fix bug where regular user could never see deleted library items when toggling show / hide deleted items. 10. Fix functional test for uploading directories of files to a library folder. ¬†The test generally failed because not enough time would elapse before checking if the files uploaded. ¬†The check is now performed in a later method in the test script, hopefully allowing for enough time to pass. 11. Functional test code clarifications for the browse_library() test method. affected #: 11 files (7.2 KB) --- a/lib/galaxy/model/__init__.py Fri Feb 04 14:48:39 2011 -0500 +++ b/lib/galaxy/model/__init__.py Fri Feb 04 16:16:00 2011 -0500 @@ -1040,33 +1040,9 @@ return template.get_widgets( trans.user ) return [] @property - def active_library_datasets( self ): - def sort_by_attr( seq, attr ): - """ - Sort the sequence of objects by object's attribute - Arguments: - seq - the list or any sequence (including immutable one) of objects to sort. - attr - the name of attribute to sort by - """ - # Use the "Schwartzian transform" - # Create the auxiliary list of tuples where every i-th tuple has form - # (seq[i].attr, i, seq[i]) and sort it. The second item of tuple is needed not - # only to provide stable sorting, but mainly to eliminate comparison of objects - # (which can be expensive or prohibited) in case of equal attribute values. - intermed = map( None, map( getattr, seq, ( attr, ) * len( seq ) ), xrange( len( seq ) ), seq ) - intermed.sort() - return map( operator.getitem, intermed, ( -1, ) * len( intermed ) ) - # This needs to be a list - active_library_datasets = [ ld for ld in self.datasets if ld.library_dataset_dataset_association and not ld.library_dataset_dataset_association.deleted ] - return sort_by_attr( [ ld for ld in active_library_datasets ], 'name' ) - @property def activatable_library_datasets( self ): # This needs to be a list return [ ld for ld in self.datasets if ld.library_dataset_dataset_association and not ld.library_dataset_dataset_association.dataset.deleted ] - @property - def active_datasets( self ): - # This needs to be a list - return [ ld.library_dataset_dataset_association.dataset for ld in self.datasets if ld.library_dataset_dataset_association and not ld.library_dataset_dataset_association.deleted ] def get_display_name( self ): # Library folder name can be either a string or a unicode object. If string, # convert to unicode object assuming 'utf-8' format. --- a/lib/galaxy/model/mapping.py Fri Feb 04 14:48:39 2011 -0500 +++ b/lib/galaxy/model/mapping.py Fri Feb 04 16:16:00 2011 -0500 @@ -1294,6 +1294,11 @@ primaryjoin=( ( LibraryDataset.table.c.folder_id == LibraryFolder.table.c.id ) ), order_by=asc( LibraryDataset.table.c._name ), lazy=False, + viewonly=True ), + active_datasets=relation( LibraryDataset, + primaryjoin=( ( LibraryDataset.table.c.folder_id == LibraryFolder.table.c.id ) & ( not_( LibraryDataset.table.c.deleted ) ) ), + order_by=asc( LibraryDataset.table.c._name ), + lazy=False, viewonly=True ) ) ) --- a/lib/galaxy/security/__init__.py Fri Feb 04 14:48:39 2011 -0500 +++ b/lib/galaxy/security/__init__.py Fri Feb 04 16:16:00 2011 -0500 @@ -270,6 +270,26 @@ .order_by( trans.app.model.Library.name ): accessible_libraries.append( library ) return accessible_libraries + def has_accessible_folders( self, trans, folder, user, roles, search_downward=True ): + if self.has_accessible_library_datasets( trans, folder, user, roles, search_downward=search_downward ) or \ + self.can_add_library_item( roles, folder ) or \ + self.can_modify_library_item( roles, folder ) or \ + self.can_manage_library_item( roles, folder ): + return True + if search_downward: + for folder in folder.active_folders: + return self.has_accessible_folders( trans, folder, user, roles, search_downward=search_downward ) + return False + def has_accessible_library_datasets( self, trans, folder, user, roles, search_downward=True ): + for library_dataset in trans.sa_session.query( trans.model.LibraryDataset ) \ + .filter( and_( trans.model.LibraryDataset.table.c.deleted == False, + trans.app.model.LibraryDataset.table.c.folder_id==folder.id ) ): + if self.can_access_library_item( roles, library_dataset, user ): + return True + if search_downward: + for folder in folder.active_folders: + return self.has_accessible_library_datasets( trans, folder, user, roles, search_downward=search_downward ) + return False def can_access_library_item( self, roles, item, user ): if type( item ) == self.model.Library: return self.can_access_library( roles, item ) @@ -504,7 +524,7 @@ permissions[ action ] = [ item_permission.role ] return permissions def get_accessible_request_types( self, trans, user ): - """Return all ReqquestTypes that the received user has permission to access.""" + """Return all RequestTypes that the received user has permission to access.""" accessible_request_types = [] current_user_role_ids = [ role.id for role in user.all_roles() ] request_type_access_action = self.permitted_actions.REQUEST_TYPE_ACCESS.action --- a/lib/galaxy/web/controllers/library_common.py Fri Feb 04 14:48:39 2011 -0500 +++ b/lib/galaxy/web/controllers/library_common.py Fri Feb 04 16:16:00 2011 -0500 @@ -1312,8 +1312,15 @@ if option_value == 'upload_directory': if is_admin and not trans.app.config.library_import_dir: continue - elif not is_admin and not trans.app.config.user_library_import_dir: - continue + elif not is_admin: + if not trans.app.config.user_library_import_dir: + continue + path = os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) + if not os.path.isdir( path ): + try: + os.makedirs( path ) + except: + continue elif option_value == 'upload_paths': if not is_admin or not trans.app.config.allow_library_path_paste: continue @@ -1553,54 +1560,70 @@ error = True message = 'You must select an action to perform on the selected datasets.' else: - # Set up the list of lddas for later, and get permission checks out of the way so we don't have to do it in multiple places later. ldda_ids = util.listify( ldda_ids ) for ldda_id in ldda_ids: try: ldda = trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ).get( trans.security.decode_id( ldda_id ) ) + lddas.append( ldda ) except: ldda = None - if not ldda or ( not is_admin and not trans.app.security_agent.can_access_library_item( current_user_roles, ldda, trans.user ) ): - error = True - message = "Invalid library dataset id ( %s ) specified." % str( ldda_id ) - break - lddas.append( ldda ) - if not is_admin: - if action == 'manage_permissions': - for ldda in lddas: - if not ( trans.app.security_agent.can_manage_library_item( current_user_roles, ldda ) and \ - trans.app.security_agent.can_manage_dataset( current_user_roles, ldda.dataset ) ): - error = True - message = "You are not authorized to manage permissions on library dataset '%s'." % ldda.name - break - elif action == 'delete': - for ldda in lddas: - if not trans.app.security_agent.can_modify_library_item( current_user_roles, ldda ): - error = True - message = "You are not authorized to modify library dataset '%s'." % ldda.name - break + message += "Invalid library dataset id (%s) specified. " % str( ldda_id ) if not error: if action == 'manage_permissions': - trans.response.send_redirect( web.url_for( controller='library_common', - action='ldda_permissions', - cntrller=cntrller, - use_panels=use_panels, - library_id=library_id, - folder_id=trans.security.encode_id( lddas[0].library_dataset.folder.id ), - id=",".join( ldda_ids ), - show_deleted=show_deleted, - message=util.sanitize_text( message ), - status=status ) ) + valid_ldda_ids = [] + valid_lddas = [] + invalid_lddas = [] + for ldda in lddas: + if trans.app.security_agent.can_manage_library_item( current_user_roles, ldda ): + valid_lddas.append( ldda ) + valid_ldda_ids.append( ldda.id ) + else: + invalid_lddas.append( ldda ) + if invalid_lddas: + message += "You are not authorized to manage permissions on %s: " % inflector.cond_plural( len( invalid_lddas ), "dataset" ) + for ldda in invalid_lddas: + message += '(%s)' % ldda.name + message += '. ' + if valid_ldda_ids: + folder_id = trans.security.encode_id( valid_lddas[0].library_dataset.folder.id ) + trans.response.send_redirect( web.url_for( controller='library_common', + action='ldda_permissions', + cntrller=cntrller, + use_panels=use_panels, + library_id=library_id, + folder_id=folder_id, + id=",".join( valid_ldda_ids ), + show_deleted=show_deleted, + message=util.sanitize_text( message ), + status=status ) ) + else: + message = "You are not authorized to manage permissions on any of the selected datasets." elif action == 'delete': + valid_lddas = [] + invalid_lddas = [] for ldda in lddas: - # Do not delete the association, just delete the library_dataset. The - # cleanup_datasets.py script handles everything else. - ld = ldda.library_dataset - ld.deleted = True - trans.sa_session.add( ld ) - trans.sa_session.flush() - message = "The selected datasets have been deleted." - elif action in ['zip','tgz','tbz','ngxzip']: + if trans.app.security_agent.can_modify_library_item( current_user_roles, ldda ): + valid_lddas.append( ldda ) + else: + invalid_lddas.append( ldda ) + if invalid_lddas: + message += "You are not authorized to delete %s: " % inflector.cond_plural( len( invalid_lddas ), "dataset" ) + for ldda in invalid_lddas: + message += '(%s)' % ldda.name + message += '. ' + if valid_lddas: + for ldda in valid_lddas: + # Do not delete the association, just delete the library_dataset. The + # cleanup_datasets.py script handles everything else. + ld = ldda.library_dataset + ld.deleted = True + trans.sa_session.add( ld ) + trans.sa_session.flush() + num_valid_lddas = len( valid_lddas ) + message += "Deleted %i %s." % ( num_valid_lddas, inflector.cond_plural( num_valid_lddas, "dataset" ) ) + else: + message = "You are not authorized to delete any of the selected datasets." + elif action in [ 'zip','tgz','tbz','ngxzip' ]: error = False killme = string.punctuation + string.whitespace trantab = string.maketrans(killme,'_'*len(killme)) @@ -1723,25 +1746,27 @@ archive.wsgi_status = trans.response.wsgi_status() archive.wsgi_headeritems = trans.response.wsgi_headeritems() return archive.stream - else: - status = 'error' - message = 'Invalid action ( %s ) specified.' % action + else: + status = 'error' + message = 'Invalid action (%s) specified.' % str( action ) if library_id: # If we have a library_id, browse the associated library return trans.response.send_redirect( web.url_for( controller='library_common', action='browse_library', cntrller=cntrller, + current_user_roles=current_user_roles, use_panels=use_panels, id=library_id, show_deleted=show_deleted, message=util.sanitize_text( message ), status=status ) ) else: - # We must have arrived here from the library_dataset_search_results page, so reddirect there. + # We arrived here from the library_dataset_search_results page, so redirect there. search_term = params.get( 'search_term', '' ) comptypes = get_comptypes( trans ) return trans.fill_template( '/library/common/library_dataset_search_results.mako', cntrller=cntrller, + current_user_roles=current_user_roles, search_term=search_term, comptypes=comptypes, lddas=lddas, @@ -2121,27 +2146,26 @@ .options( eagerload_all( "actions" ) ) \ .order_by( trans.app.model.LibraryFolder.table.c.name ) \ .all() -def active_folders_and_lddas( trans, folder ): +def active_folders_and_library_datasets( trans, folder ): folders = active_folders( trans, folder ) - # This query is much faster than the folder.active_library_datasets property - lddas = trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ) \ - .filter_by( deleted=False ) \ - .join( "library_dataset" ) \ - .filter( trans.app.model.LibraryDataset.table.c.folder_id==folder.id ) \ - .order_by( trans.app.model.LibraryDatasetDatasetAssociation.table.c.name ) \ - .all() - return folders, lddas -def activatable_folders_and_lddas( trans, folder ): + library_datasets = trans.sa_session.query( trans.model.LibraryDataset ) \ + .filter( and_( trans.model.LibraryDataset.table.c.deleted == False, + trans.model.LibraryDataset.table.c.folder_id == folder.id ) ) \ + .order_by( trans.model.LibraryDataset.table.c._name ) \ + .all() + return folders, library_datasets +def activatable_folders_and_library_datasets( trans, folder ): folders = activatable_folders( trans, folder ) - # This query is much faster than the folder.activatable_library_datasets property - lddas = trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ) \ - .join( "library_dataset" ) \ - .filter( trans.app.model.LibraryDataset.table.c.folder_id==folder.id ) \ - .join( "dataset" ) \ - .filter( trans.app.model.Dataset.table.c.deleted==False ) \ - .order_by( trans.app.model.LibraryDatasetDatasetAssociation.table.c.name ) \ - .all() - return folders, lddas + library_datasets = trans.sa_session.query( trans.model.LibraryDataset ) \ + .filter( trans.model.LibraryDataset.table.c.folder_id == folder.id ) \ + .join( ( trans.model.LibraryDatasetDatasetAssociation.table, + trans.model.LibraryDataset.table.c.library_dataset_dataset_association_id == trans.model.LibraryDatasetDatasetAssociation.table.c.id ) ) \ + .join( ( trans.model.Dataset.table, + trans.model.LibraryDatasetDatasetAssociation.table.c.dataset_id == trans.model.Dataset.table.c.id ) ) \ + .filter( trans.model.Dataset.table.c.deleted == False ) \ + .order_by( trans.model.LibraryDataset.table.c._name ) \ + .all() + return folders, library_datasets def branch_deleted( folder ): # Return True if a folder belongs to a branch that has been deleted if folder.deleted: --- a/templates/library/common/browse_library.mako Fri Feb 04 14:48:39 2011 -0500 +++ b/templates/library/common/browse_library.mako Fri Feb 04 16:16:00 2011 -0500 @@ -213,7 +213,9 @@ ## children, which are always lddas ). We also need to make sure we're displaying the latest version of this ## library_dataset, so we display the attributes from the ldda. - from galaxy.web.controllers.library_common import active_folders, active_folders_and_lddas, activatable_folders_and_lddas, branch_deleted + from galaxy.web.controllers.library_common import branch_deleted + + is_admin = trans.user_is_admin() and cntrller == 'library_admin' if ldda.user: uploaded_by = ldda.user.email @@ -221,7 +223,7 @@ uploaded_by = 'anonymous' if ldda == library_dataset.library_dataset_dataset_association: current_version = True - if trans.user_is_admin() and cntrller == 'library_admin': + if is_admin: can_modify = can_manage = True elif cntrller in [ 'library', 'requests' ]: can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library_dataset ) @@ -307,7 +309,10 @@ <%def name="render_folder( cntrller, folder, folder_pad, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=False, parent=None, row_counter=None, root_folder=False )"><% - from galaxy.web.controllers.library_common import active_folders, active_folders_and_lddas, activatable_folders_and_lddas, branch_deleted + from galaxy.web.controllers.library_common import active_folders, active_folders_and_library_datasets, activatable_folders_and_library_datasets, branch_deleted + + is_admin = trans.user_is_admin() and cntrller == 'library_admin' + if root_folder: pad = folder_pad expander = h.url_for("/static/images/silk/resultset_bottom.png") @@ -321,7 +326,7 @@ if str( folder.id ) in hidden_folder_ids: return "" my_row = None - if trans.user_is_admin() and cntrller == 'library_admin': + if is_admin: can_add = can_modify = can_manage = True elif cntrller in [ 'library' ]: can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, folder ) @@ -340,8 +345,11 @@ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, folder ) else: can_add = can_modify = can_manage = False + form_type = trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE info_association, inherited = folder.get_info_association( restrict=True ) + + has_accessible_datasets = trans.app.security_agent.has_accessible_library_datasets( trans, folder, trans.user, current_user_roles, search_downward=False ) %> %if not root_folder and ( not folder.deleted or show_deleted ): <% encoded_id = trans.security.encode_id(folder.id) %> @@ -371,7 +379,9 @@ <a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add sub-folder</a> %endif %if not branch_deleted( folder ): - <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select folder datasets for import into selected histories</a> + %if has_accessible_datasets: + <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select datasets for import into selected histories</a> + %endif %if can_modify: <a class="action-button" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a> %else: @@ -412,12 +422,28 @@ row_counter.increment() %> %endif - %if cntrller == 'library': - <% sub_folders = active_folders( trans, folder ) %> + <% + if show_deleted: + sub_folders, library_datasets = activatable_folders_and_library_datasets( trans, folder ) + else: + sub_folders, library_datasets = active_folders_and_library_datasets( trans, folder ) + %> + %if is_admin: + %for sub_folder in sub_folders: + ${render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )} + %endfor + %for library_dataset in library_datasets: + <% + ldda = library_dataset.library_dataset_dataset_association + selected = created_ldda_ids and str( ldda.id ) in created_ldda_ids + %> + ${render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )} + %endfor + %else: %for sub_folder in sub_folders: ${render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )} %endfor - %for library_dataset in folder.active_library_datasets: + %for library_dataset in library_datasets: <% ldda = library_dataset.library_dataset_dataset_association can_access = trans.app.security_agent.can_access_dataset( current_user_roles, ldda.dataset ) @@ -427,23 +453,6 @@ ${render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )} %endif %endfor - %elif trans.user_is_admin() and cntrller == 'library_admin': - <% - if show_deleted: - sub_folders, lddas = activatable_folders_and_lddas( trans, folder ) - else: - sub_folders, lddas = active_folders_and_lddas( trans, folder ) - %> - %for sub_folder in sub_folders: - ${render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )} - %endfor - %for ldda in lddas: - <% - library_dataset = ldda.library_dataset - selected = created_ldda_ids and str( ldda.id ) in created_ldda_ids - %> - ${render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )} - %endfor %endif </%def> @@ -453,7 +462,9 @@ from galaxy.web.controllers.library_common import branch_deleted from time import strftime - if trans.user_is_admin() and cntrller == 'library_admin': + is_admin = trans.user_is_admin() and cntrller == 'library_admin' + + if is_admin: can_add = can_modify = can_manage = True elif cntrller in [ 'library', 'requests' ]: can_add = trans.app.security_agent.can_add_library_item( current_user_roles, library ) @@ -461,11 +472,15 @@ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library ) else: can_add = can_modify = can_manage = False + info_association, inherited = library.get_info_association() form_type = trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE - + + has_accessible_datasets = trans.app.security_agent.has_accessible_library_datasets( trans, library.root_folder, trans.user, current_user_roles, search_downward=False ) + has_accessible_folders = is_admin or trans.app.security_agent.has_accessible_folders( trans, library.root_folder, trans.user, current_user_roles ) + tracked_datasets = {} - + class RowCounter( object ): def __init__( self ): self.count = 0 @@ -478,7 +493,7 @@ <h2>Data Library “${library.name}”</h2><ul class="manage-table-actions"> - %if not library.deleted and ( ( trans.user_is_admin() and cntrller == 'library_admin' ) or can_add ): + %if not library.deleted and ( is_admin or can_add ): <li><a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a></li><li><a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( library.root_folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add folder</a></li> %endif @@ -508,7 +523,9 @@ %endif <a class="action-button" href="${h.url_for( controller='library_common', action='library_permissions', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a> %endif - <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select datasets for import into selected histories</a> + %if has_accessible_datasets: + <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select datasets for import into selected histories</a> + %endif %elif can_modify and not library.purged: <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library', use_panels=use_panels )}">Undelete this data library</a> %elif library.purged: @@ -528,13 +545,18 @@ </div><br/> %endif - - <form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post"> + + %if has_accessible_datasets: + <form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post"> + %endif + %if has_accessible_folders: <table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid" id="library-grid"><thead><tr class="libraryTitle"><th> - <input type="checkbox" id="checkAll" name=select_all_datasets_checkbox value="true" onclick='checkAllFields(1);'/><input type="hidden" name=select_all_datasets_checkbox value="true"/> + %if has_accessible_datasets: + <input type="checkbox" id="checkAll" name=select_all_datasets_checkbox value="true" onclick='checkAllFields(1);'/><input type="hidden" name=select_all_datasets_checkbox value="true"/> + %endif Name </th><th>Message</th> @@ -546,18 +568,21 @@ <% row_counter = RowCounter() %> %if cntrller in [ 'library', 'requests' ]: ${self.render_folder( 'library', library.root_folder, 0, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True )} - %if not library.deleted: + %if not library.deleted and has_accessible_datasets: ${render_actions_on_multiple_items()} %endif %elif ( trans.user_is_admin() and cntrller in [ 'library_admin', 'requests_admin' ] ): ${self.render_folder( 'library_admin', library.root_folder, 0, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True )} - %if not library.deleted and not show_deleted: + %if not library.deleted and not show_deleted and has_accessible_datasets: ${render_actions_on_multiple_items()} %endif %endif </table> - </form> - + %endif + %if has_accessible_datasets: + </form> + %endif + %if tracked_datasets: <script type="text/javascript"> // Updater @@ -566,5 +591,10 @@ <!-- running: do not change this comment, used by TwillTestCase.library_wait --> %endif - ${render_compression_types_help( comptypes )} + %if has_accessible_datasets: + ${render_compression_types_help( comptypes )} + %endif + %if not has_accessible_folders: + The data library '${library.name}' does not contain any datasets that you can access. + %endif </%def> --- a/templates/library/common/common.mako Fri Feb 04 14:48:39 2011 -0500 +++ b/templates/library/common/common.mako Fri Feb 04 16:16:00 2011 -0500 @@ -395,7 +395,7 @@ <%def name="render_actions_on_multiple_items( actions_to_exclude=[] )"><% is_admin = trans.user_is_admin() and cntrller=='library_admin' - can_delete = 'delete' not in actions_to_exclude and is_admin + can_delete = 'delete' not in actions_to_exclude can_download = 'download' not in actions_to_exclude can_import_to_histories = 'import_to_histories' not in actions_to_exclude can_manage_permissions = 'manage_permissions' not in actions_to_exclude --- a/templates/library/common/library_dataset_search_results.mako Fri Feb 04 14:48:39 2011 -0500 +++ b/templates/library/common/library_dataset_search_results.mako Fri Feb 04 16:16:00 2011 -0500 @@ -95,6 +95,7 @@ <p>The string "${search_term}" was found in at least one of the following information components of the displayed library datasets.</p> ${render_searched_components()} <form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post"> + <input type="hidden" name=search_term value="${search_term}"/><table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid" id="library-grid"><thead><tr class="libraryTitle"> --- a/test/base/twilltestcase.py Fri Feb 04 14:48:39 2011 -0500 +++ b/test/base/twilltestcase.py Fri Feb 04 16:16:00 2011 -0500 @@ -1844,10 +1844,8 @@ raise AssertionError, "String (%s) incorrectly displayed when browing library." % check_str except: pass - def browse_library( self, cntrller, id, show_deleted=False, strings_displayed=[], strings_not_displayed=[] ): - self.visit_url( '%s/library_common/browse_library?cntrller=%s&id=%s&show_deleted=%s' % ( self.url, cntrller, id, str( show_deleted ) ) ) - data=self.last_page() - file( 'greg.html', 'wb' ).write( data ) + def browse_library( self, cntrller, library_id, show_deleted=False, strings_displayed=[], strings_not_displayed=[] ): + self.visit_url( '%s/library_common/browse_library?cntrller=%s&id=%s&show_deleted=%s' % ( self.url, cntrller, library_id, str( show_deleted ) ) ) for check_str in strings_displayed: self.check_page_for_string( check_str ) for check_str in strings_not_displayed: --- a/test/functional/test_library_features.py Fri Feb 04 14:48:39 2011 -0500 +++ b/test/functional/test_library_features.py Fri Feb 04 16:16:00 2011 -0500 @@ -78,8 +78,8 @@ global folder1 folder1 = get_folder( root_folder.id, name, description ) assert folder1 is not None, 'Problem retrieving library folder named "%s" from the database' % name - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name, folder1.description ] ) def test_035_add_subfolder_to_folder( self ): """Testing adding a folder to a folder""" @@ -94,8 +94,8 @@ global subfolder1 subfolder1 = get_folder( folder1.id, name, description ) assert subfolder1 is not None, 'Problem retrieving subfolder1 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ subfolder1.name, subfolder1.description ] ) def test_040_add_2nd_folder_to_library1( self ): """Testing adding a 2nd folder to a library1""" @@ -110,8 +110,8 @@ global folder2 folder2 = get_folder( library1.root_folder.id, name, description ) assert folder2 is not None, 'Problem retrieving library folder named "%s" from the database' % name - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder2.name, folder2.description ] ) def test_045_add_public_dataset_to_folder2( self ): """Testing adding a public dataset to folder2""" @@ -129,8 +129,8 @@ global ldda2 ldda2 = get_latest_ldda_by_name( filename ) assert ldda2 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda2 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda2.name, ldda2.message, admin_user.email ] ) def test_050_add_2nd_public_dataset_to_folder2( self ): """Testing adding a 2nd public dataset folder2""" @@ -148,8 +148,8 @@ global ldda3 ldda3 = get_latest_ldda_by_name( filename ) assert ldda3 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda3 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda3.name, ldda3.message, admin_user.email ] ) def test_055_copy_dataset_from_history_to_subfolder( self ): """Testing copying a dataset from the current history to a subfolder""" @@ -168,8 +168,8 @@ global ldda4 ldda4 = get_latest_ldda_by_name( filename ) assert ldda4 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda4 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda4.name, ldda4.message, admin_user.email ] ) def test_060_editing_dataset_attribute_info( self ): """Testing editing a library dataset's attribute information""" @@ -182,8 +182,8 @@ ldda4.name, new_ldda_name=new_ldda_name ) refresh( ldda4 ) - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ new_ldda_name, ldda4.message ] ) def test_065_uploading_new_dataset_version( self ): """Testing uploading a new version of a library dataset""" @@ -216,8 +216,8 @@ ldda4.name, strings_displayed=[ 'This is an expired version of this library dataset' ] ) # Make sure ldda4 is no longer displayed in the library - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ ldda4.name, ldda4.message ] ) def test_070_upload_directory_of_files_from_libraries_view( self ): """Testing uploading a directory of files to a root folder from the Data Libraries view""" @@ -249,9 +249,6 @@ server_dir=regular_user1.email, ldda_message=ldda_message, strings_displayed = [ "Upload a directory of files" ] ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), - strings_displayed=[ regular_user1.email, ldda_message, '1.fasta' ] ) self.logout() self.login( regular_user3.email ) ldda_message = 'Uploaded all files in test-data/users/test3.../run1' @@ -264,9 +261,6 @@ server_dir='run1', ldda_message=ldda_message, strings_displayed=[ 'Upload a directory of files', '<option>None</option>' ] ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), - strings_displayed=[ regular_user3.email, ldda_message, '2.fasta' ] ) def test_075_download_archive_of_library_files( self ): """Testing downloading an archive of files from library1""" # logged in as regular_user3 @@ -290,7 +284,21 @@ format=format ) self.check_archive_contents( archive, ( ldda1, ldda2 ) ) os.remove( archive ) - def test_080_mark_ldda2_deleted( self ): + def test_080_check_libraries_for_uploaded_directories_of_files( self ): + """Testing the results of uploading directories of files to library1""" + # We'll make sure the directories of files were uploaded in test_070... above. + # We do this here because the check would generally fail if we did it in the + # test_070... method since the files would not finish uploading before the check + # was done. Hopefully doing the check here will allow for enough time... + ldda_message = 'Uploaded all files in test-data/users/test1...' + self.browse_library( 'library', + self.security.encode_id( library1.id ), + strings_displayed=[ regular_user1.email, ldda_message, '1.fasta' ] ) + ldda_message = 'Uploaded all files in test-data/users/test3.../run1' + self.browse_library( 'library', + self.security.encode_id( library1.id ), + strings_displayed=[ regular_user3.email, ldda_message, '2.fasta' ] ) + def test_085_mark_ldda2_deleted( self ): """Testing marking ldda2 as deleted""" # Logged in as admin_user self.delete_library_item( 'library_admin', @@ -298,20 +306,20 @@ self.security.encode_id( ldda2.library_dataset.id ), ldda2.name, item_type='library_dataset' ) - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ ldda2.name, ldda2.message ] ) - def test_085_display_and_hide_deleted_ldda2( self ): + def test_090_display_and_hide_deleted_ldda2( self ): """Testing displaying and hiding a deleted ldda2""" # Logged in as admin_user - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), show_deleted=True, strings_displayed=[ ldda2.name, ldda2.message ] ) self.browse_library( 'library_admin', self.security.encode_id( library1.id ), strings_not_displayed=[ ldda2.name, ldda2.message ] ) - def test_090_mark_folder2_deleted( self ): + def test_095_mark_folder2_deleted( self ): """Testing marking folder2 as deleted""" # Logged in as admin_user self.delete_library_item( 'library_admin', @@ -319,10 +327,10 @@ self.security.encode_id( folder2.id ), folder2.name, item_type='folder' ) - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ folder2.name ] ) - def test_095_mark_folder_undeleted( self ): + def test_100_mark_folder_undeleted( self ): """Testing marking a library folder as undeleted""" # Logged in as admin_user self.undelete_library_item( 'library_admin', @@ -332,11 +340,11 @@ item_type='folder' ) # 2.bed was deleted before the folder was deleted, so state should have been saved. In order # for 2.bed to be displayed, it would itself have to be marked undeleted. - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder2.name ], strings_not_displayed=[ ldda2.name ] ) - def test_100_mark_library_deleted( self ): + def test_105_mark_library_deleted( self ): """Testing marking a library as deleted""" # Logged in as admin_user # First mark folder2 as deleted to further test state saving when we undelete the library @@ -352,7 +360,7 @@ item_type='library' ) self.browse_libraries_admin( strings_not_displayed=[ library1.name ] ) self.browse_libraries_admin( deleted=True, strings_displayed=[ library1.name ] ) - def test_105_mark_library_undeleted( self ): + def test_110_mark_library_undeleted( self ): """Testing marking a library as undeleted""" # Logged in as admin_user self.undelete_library_item( 'library_admin', @@ -361,11 +369,11 @@ library1.name, item_type='library' ) self.browse_libraries_admin( strings_displayed=[ library1.name ] ) - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), - strings_displayed=[ library1.name ], - strings_not_displayed=[ folder2.name ] ) - def test_110_purge_library( self ): + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), + strings_displayed=[ library1.name ], + strings_not_displayed=[ folder2.name ] ) + def test_115_purge_library( self ): """Testing purging a library""" # Logged in as admin_user self.delete_library_item( 'library_admin', --- a/test/functional/test_library_security.py Fri Feb 04 14:48:39 2011 -0500 +++ b/test/functional/test_library_security.py Fri Feb 04 16:16:00 2011 -0500 @@ -155,8 +155,8 @@ global ldda1 ldda1 = get_latest_ldda_by_name( filename ) assert ldda1 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda1 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda1.name, ldda1.message, admin_user.email ] ) def test_030_access_ldda1_with_private_role_restriction( self ): """Testing accessing ldda1 with a private role restriction""" @@ -174,16 +174,16 @@ # 'test3@bx.psu.edu' ( regular_user3's private role ) since regular_user3 has Role1 # # admin_user should not be able to see 1.bed from the analysis view's access libraries - self.browse_library( 'library', - self.security.encode_id( library1.id ), - strings_not_displayed=[ folder1.name, ldda1.name, ldda1.message ] ) + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), + strings_not_displayed=[ folder1.name, ldda1.name, ldda1.message ] ) self.logout() # regular_user1 should be able to see 1.bed from the Data Libraries view # since it was associated with regular_user1's private role self.login( email=regular_user1.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), - strings_displayed=[ folder1.name, ldda1.name, ldda1.message ] ) + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), + strings_displayed=[ folder1.name, ldda1.name, ldda1.message ] ) self.logout() # regular_user2 should not be to see library1 since they do not have # Role1 which is associated with the LIBRARY_ACCESS permission @@ -192,8 +192,8 @@ self.logout() # regular_user3 should not be able to see 1.bed from the analysis view's access librarys self.login( email=regular_user3.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ folder1.name ] ) self.logout() self.login( email=admin_user.email ) @@ -229,8 +229,8 @@ permissions_out, ldda_name=ldda1.name ) # admin_user should now be able to see 1.bed from the analysis view's access libraries - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda1.name, ldda1.message ] ) def test_040_create_ldda2_with_role2_associated_with_group_and_users( self ): """Testing creating ldda2 with a role that is associated with a group and users""" @@ -261,20 +261,20 @@ ldda2 = get_latest_ldda_by_name( filename ) assert ldda2 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda2 from the database' self.browse_library( cntrller='library', - id=self.security.encode_id( library1.id ), + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda2.name, ldda2.message, admin_user.email ] ) def test_045_accessing_ldda2_with_role_associated_with_group_and_users( self ): """Testing accessing ldda2 with a role that is associated with a group and users""" # Logged in as admin_user # admin_user should be able to see 2.bed since she is associated with role2 - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda2.name, ldda2.message, admin_user.email ] ) self.logout() # regular_user1 should be able to see 2.bed since she is associated with group_two self.login( email = regular_user1.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name, ldda2.name, ldda2.message, admin_user.email ] ) # Check the permissions on the dataset 2.bed - they are as folows: # DATASET_MANAGE_PERMISSIONS = test@bx.psu.edu @@ -304,15 +304,15 @@ self.logout() # regular_user2 should not be able to see ldda2 self.login( email=regular_user2.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ folder1.name, ldda2.name, ldda2.message ] ) self.logout() # regular_user3 should not be able to see ldda2 self.login( email=regular_user3.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name ], strings_not_displayed=[ ldda2.name, ldda2.message ] ) self.logout() @@ -325,8 +325,8 @@ self.logout() # regular_user2 should now be able to see ldda2 self.login( email=regular_user2.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name, ldda2.name, ldda2.message ] ) self.logout() self.login( email=admin_user.email ) @@ -338,8 +338,8 @@ self.logout() # regular_user3 should now be able to see ldda1 self.login( email=regular_user3.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name, ldda1.name, ldda1.message ] ) self.logout() self.login( email=admin_user.email ) @@ -354,8 +354,8 @@ server_dir='library', ldda_message=ldda_message, strings_displayed=[ "Upload a directory of files" ] ) - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ admin_user.email, ldda_message ] ) def test_055_change_permissions_on_datasets_uploaded_from_library_dir( self ): """Testing changing the permissions on datasets uploaded from a directory from the Admin view""" @@ -403,8 +403,8 @@ # Since regular_user2 is not associated with role1, she should not have # access to any of the 3 datasets, so she will not see folder1 on the libraries page self.login( email=regular_user2.email ) - self.browse_library( 'library', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library1.id ), strings_not_displayed=[ folder1.name ] ) self.logout() # regular_user3 is associated with role1, so should have all permissions on imported datasets @@ -538,8 +538,8 @@ self.login( email=regular_user2.email ) self.visit_url( '%s/library/browse_libraries' % self.url ) self.check_page_for_string( library2.name ) - self.browse_library( 'library', - self.security.encode_id( library2.id ), + self.browse_library( cntrller='library', + library_id=self.security.encode_id( library2.id ), strings_displayed=[ ldda6.name, ldda6.message, ldda7.name, ldda7.message, ldda8.name, ldda8.message ] ) def test_999_reset_data_for_later_test_runs( self ): """Reseting data to enable later test runs to pass""" --- a/test/functional/test_library_templates.py Fri Feb 04 14:48:39 2011 -0500 +++ b/test/functional/test_library_templates.py Fri Feb 04 16:16:00 2011 -0500 @@ -136,8 +136,8 @@ def test_025_check_library1( self ): """Checking library1 and its root folder""" # Logged in as admin_user - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ folder1.name, folder1.description ] ) # Make sure the template and contents were inherited to folder1 self.folder_info( cntrller='library_admin', @@ -179,8 +179,8 @@ global ldda1 ldda1 = get_latest_ldda_by_name( filename ) assert ldda1 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda1 from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library1.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library1.id ), strings_displayed=[ ldda1.name, ldda1.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -275,8 +275,8 @@ def test_060_check_library2( self ): """Checking library2 and its root folder""" # Logged in as admin_user - self.browse_library( 'library_admin', - self.security.encode_id( library2.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library2.id ), strings_displayed=[ folder2.name, folder2.description ] ) def test_065_save_folder2_inherited_template( self ): """Saving the inherited template for folder2""" @@ -306,8 +306,8 @@ strings_displayed=[ 'CheckboxField', 'checked' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library2.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library2.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -347,8 +347,8 @@ def test_090_check_library3( self ): """Checking library3 and its root folder""" # Logged in as admin_user - self.browse_library( 'library_admin', - self.security.encode_id( library3.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library3.id ), strings_displayed=[ folder3.name, folder3.description ] ) def test_095_save_folder3_inherited_template( self ): """Saving the inherited template for folder3""" @@ -379,8 +379,8 @@ strings_displayed=[ 'SelectField', 'selected>Option1' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library3.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library3.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -402,8 +402,8 @@ strings_displayed=[ '<input type="hidden" name="%s" value="Option1"/>' % select_field_name ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library3.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library3.id ), strings_displayed=[ ldda.name, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -469,8 +469,8 @@ strings_displayed=[ 'TextArea', 'This text should be inherited' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library4.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library4.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -535,8 +535,8 @@ strings_displayed=[ 'TextField', 'This text should be inherited' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library5.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library5.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -577,8 +577,8 @@ 'TextArea' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library5.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library5.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', @@ -642,8 +642,8 @@ strings_displayed=[ 'WorkflowField', 'none' ] ) ldda = get_latest_ldda_by_name( filename ) assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database' - self.browse_library( 'library_admin', - self.security.encode_id( library6.id ), + self.browse_library( cntrller='library_admin', + library_id=self.security.encode_id( library6.id ), strings_displayed=[ ldda.name, ldda.message, admin_user.email ] ) # Make sure the library template contents were correctly saved self.ldda_edit_info( 'library_admin', 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.