From f14ed0317b02db22af2f66d65e5f045011e77143 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sun, 5 Jul 2015 14:14:11 +0100 Subject: [PATCH] Indentation and typo fixes. --- lib/galaxy/managers/collections_util.py | 2 +- lib/galaxy/managers/libraries.py | 21 ++++++++++++++------- lib/galaxy/managers/workflows.py | 7 ++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/galaxy/managers/collections_util.py b/lib/galaxy/managers/collections_util.py index 6a44a331e9f..ad192ced475 100644 --- a/lib/galaxy/managers/collections_util.py +++ b/lib/galaxy/managers/collections_util.py @@ -79,7 +79,7 @@ def dictify_dataset_collection_instance( dataset_collection_instance, parent, se collection = dataset_collection_instance.collection dict_value[ 'elements' ] = map( dictify_element, collection.elements ) dict_value[ 'populated' ] = collection.populated - security.encode_all_ids( dict_value, recursive=True ) # TODO: Use Kyle's recusrive formulation of this. + security.encode_all_ids( dict_value, recursive=True ) # TODO: Use Kyle's recursive formulation of this. return dict_value diff --git a/lib/galaxy/managers/libraries.py b/lib/galaxy/managers/libraries.py index f8e4023bf78..931596f0c9c 100644 --- a/lib/galaxy/managers/libraries.py +++ b/lib/galaxy/managers/libraries.py @@ -119,13 +119,20 @@ class LibraryManager( object ): # Nonadmins can't see deleted libraries current_user_role_ids = [ role.id for role in trans.get_current_user_roles() ] library_access_action = trans.app.security_agent.permitted_actions.LIBRARY_ACCESS.action - restricted_library_ids = [ lp.library_id for lp in ( trans.sa_session.query( trans.model.LibraryPermissions ) - .filter( trans.model.LibraryPermissions.table.c.action == library_access_action ) - .distinct() ) ] - accessible_restricted_library_ids = [ lp.library_id for lp in ( trans.sa_session.query( trans.model.LibraryPermissions ) - .filter( and_( trans.model.LibraryPermissions.table.c.action == library_access_action, - trans.model.LibraryPermissions.table.c.role_id.in_( current_user_role_ids ) ) ) ) ] - query = query.filter( or_( not_( trans.model.Library.table.c.id.in_( restricted_library_ids ) ), trans.model.Library.table.c.id.in_( accessible_restricted_library_ids ) ) ) + restricted_library_ids = [ lp.library_id for lp in ( + trans.sa_session.query( trans.model.LibraryPermissions ).filter( + trans.model.LibraryPermissions.table.c.action == library_access_action + ).distinct() ) ] + accessible_restricted_library_ids = [ lp.library_id for lp in ( + trans.sa_session.query( trans.model.LibraryPermissions ).filter( + and_( + trans.model.LibraryPermissions.table.c.action == library_access_action, + trans.model.LibraryPermissions.table.c.role_id.in_( current_user_role_ids ) + ) ) ) ] + query = query.filter( or_( + not_( trans.model.Library.table.c.id.in_( restricted_library_ids ) ), + trans.model.Library.table.c.id.in_( accessible_restricted_library_ids ) + ) ) return query def secure( self, trans, library, check_accessible=True ): diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index 7f4ef608f19..ef3767a16c1 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -455,9 +455,10 @@ class WorkflowContentsManager(UsesAnnotations): if module.type == 'tool': pja_dict = {} for pja in step.post_job_actions: - pja_dict[pja.action_type + pja.output_name] = dict( action_type=pja.action_type, - output_name=pja.output_name, - action_arguments=pja.action_arguments ) + pja_dict[pja.action_type + pja.output_name] = dict( + action_type=pja.action_type, + output_name=pja.output_name, + action_arguments=pja.action_arguments ) step_dict[ 'post_job_actions' ] = pja_dict # Data inputs step_dict['inputs'] = module.get_runtime_input_dicts( annotation_str )