1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fd6cd92888ed/ Changeset: fd6cd92888ed User: greg Date: 2014-01-22 22:52:18 Summary: Pep-8 fixes for the base admin controller. Affected #: 1 file diff -r fe2fdbbecd853aafbd0d5748c796d37399d98bd6 -r fd6cd92888edf53c86378e3ec36dae1e0cf54884 lib/galaxy/web/base/controllers/admin.py --- a/lib/galaxy/web/base/controllers/admin.py +++ b/lib/galaxy/web/base/controllers/admin.py @@ -6,8 +6,8 @@ from galaxy.web.form_builder import CheckboxField from string import punctuation as PUNCTUATION +log = logging.getLogger( __name__ ) -log = logging.getLogger( __name__ ) class Admin( object ): # Override these @@ -38,6 +38,7 @@ return trans.fill_template( '/webapps/tool_shed/admin/index.mako', message=message, status=status ) + @web.expose @web.require_admin def center( self, trans, **kwd ): @@ -51,6 +52,7 @@ return trans.fill_template( '/webapps/tool_shed/admin/center.mako', message=message, status=status ) + @web.expose @web.require_admin def reload_tool( self, trans, **kwd ): @@ -67,13 +69,14 @@ toolbox=toolbox, message=message, status=status ) + @web.expose @web.require_admin def tool_versions( self, trans, **kwd ): if 'message' not in kwd or not kwd[ 'message' ]: kwd[ 'message' ] = 'Tool ids for tools that are currently loaded into the tool panel are highlighted in green (click to display).' return self.tool_version_list_grid( trans, **kwd ) - # Galaxy Role Stuff + @web.expose @web.require_admin def roles( self, trans, **kwargs ): @@ -95,6 +98,7 @@ return self.rename_role( trans, **kwargs ) # Render the list view return self.role_list_grid( trans, **kwargs ) + @web.expose @web.require_admin def create_role( self, trans, **kwd ): @@ -169,6 +173,7 @@ create_group_for_role_checked=create_group_for_role_checked, message=message, status=status ) + @web.expose @web.require_admin def rename_role( self, trans, **kwd ): @@ -210,6 +215,7 @@ role=role, message=message, status=status ) + @web.expose @web.require_admin def manage_users_and_groups_for_role( self, trans, **kwd ): @@ -302,6 +308,7 @@ library_dataset_actions=library_dataset_actions, message=message, status=status ) + @web.expose @web.require_admin def mark_role_deleted( self, trans, **kwd ): @@ -324,6 +331,7 @@ action='roles', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def undelete_role( self, trans, **kwd ): @@ -355,6 +363,7 @@ action='roles', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def purge_role( self, trans, **kwd ): @@ -408,7 +417,6 @@ message=util.sanitize_text( message ), status='done' ) ) - # Galaxy Group Stuff @web.expose @web.require_admin def groups( self, trans, **kwargs ): @@ -430,6 +438,7 @@ return self.rename_group( trans, **kwargs ) # Render the list view return self.group_list_grid( trans, **kwargs ) + @web.expose @web.require_admin def rename_group( self, trans, **kwd ): @@ -469,6 +478,7 @@ group=group, message=message, status=status ) + @web.expose @web.require_admin def manage_users_and_roles_for_group( self, trans, **kwd ): @@ -513,6 +523,7 @@ out_users=out_users, message=message, status=status ) + @web.expose @web.require_admin def create_group( self, trans, **kwd ): @@ -588,6 +599,7 @@ create_role_for_group_checked=create_role_for_group_checked, message=message, status=status ) + @web.expose @web.require_admin def mark_group_deleted( self, trans, **kwd ): @@ -611,6 +623,7 @@ action='groups', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def undelete_group( self, trans, **kwd ): @@ -642,6 +655,7 @@ action='groups', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def purge_group( self, trans, **kwd ): @@ -678,13 +692,13 @@ message=util.sanitize_text( message ), status='done' ) ) - # Galaxy User Stuff @web.expose @web.require_admin def create_new_user( self, trans, **kwd ): return trans.response.send_redirect( web.url_for( controller='user', action='create', cntrller='admin' ) ) + @web.expose @web.require_admin def reset_user_password( self, trans, **kwd ): @@ -730,6 +744,7 @@ users=users, password='', confirm='' ) + @web.expose @web.require_admin def mark_user_deleted( self, trans, **kwd ): @@ -752,6 +767,7 @@ action='users', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def undelete_user( self, trans, **kwd ): @@ -783,6 +799,7 @@ action='users', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def purge_user( self, trans, **kwd ): @@ -850,6 +867,7 @@ action='users', message=util.sanitize_text( message ), status='done' ) ) + @web.expose @web.require_admin def users( self, trans, **kwd ): @@ -888,6 +906,7 @@ self.user_list_grid.operations.append( self.purge_operation ) # Render the list view return self.user_list_grid( trans, **kwd ) + @web.expose @web.require_admin def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ): @@ -896,6 +915,7 @@ for user in trans.sa_session.query( trans.app.model.User ).filter_by( deleted=False ).filter( func.lower( trans.app.model.User.email ).like( q.lower() + "%" ) ): ac_data = ac_data + user.email + "\n" return ac_data + @web.expose @web.require_admin def manage_roles_and_groups_for_user( self, trans, **kwd ): @@ -968,6 +988,7 @@ out_groups=out_groups, message=message, status=status ) + @web.expose @web.require_admin def memdump( self, trans, ids = 'None', sorts = 'None', pages = 'None', new_id = None, new_sort = None, **kwd ): @@ -1089,12 +1110,14 @@ if not user: return trans.show_error_message( "User not found for id (%s)" % str( user_id ) ) return user + def get_user_by_username( trans, username ): """Get a user from the database by username""" # TODO: Add exception handling here. return trans.sa_session.query( trans.model.User ) \ .filter( trans.model.User.table.c.username == username ) \ .one() + def get_role( trans, id ): """Get a Role from the database by id.""" # Load user from database @@ -1103,6 +1126,7 @@ if not role: return trans.show_error_message( "Role not found for id (%s)" % str( id ) ) return role + def get_group( trans, id ): """Get a Group from the database by id.""" # Load user from database @@ -1111,6 +1135,7 @@ if not group: return trans.show_error_message( "Group not found for id (%s)" % str( id ) ) return group + def get_quota( trans, id ): """Get a Quota from the database by id.""" # Load user from database 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.