From eeeab78b324a39d17b3c6d8835d9ca388c53eb02 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Fri, 21 Nov 2008 09:21:39 -0500 Subject: [PATCH] Fixes for accessing libraries from the analysis view. --- lib/galaxy/web/controllers/library.py | 3 ++- lib/galaxy/web/framework/__init__.py | 5 +++-- test/functional/test_security_and_libraries.py | 2 +- tools/data_source/access_libraries.xml | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/web/controllers/library.py b/lib/galaxy/web/controllers/library.py index 5db40832306..895e4bf1d25 100644 --- a/lib/galaxy/web/controllers/library.py +++ b/lib/galaxy/web/controllers/library.py @@ -7,7 +7,8 @@ log = logging.getLogger( __name__ ) class Library( BaseController ): @web.expose def browse( self, trans, **kwd ): - return trans.fill_template( '/library/browser.mako', libraries=trans.app.model.Library.filter_by( deleted=False ).all() ) + libraries=trans.app.model.Library.filter_by( deleted=False ).order_by( trans.app.model.Library.table.c.name ).all() + return trans.fill_template( '/library/browser.mako', libraries=libraries ) index = browse @web.expose def import_datasets( self, trans, import_ids=[], **kwd ): diff --git a/lib/galaxy/web/framework/__init__.py b/lib/galaxy/web/framework/__init__.py index ff51ec616c1..436c91d7668 100644 --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -64,10 +64,10 @@ def require_admin( func ): def decorator( self, trans, *args, **kwargs ): admin_users = trans.app.config.get( "admin_users", "" ).split( "," ) if not admin_users: - return trans.show_error_message( "You must be an administrator to access this feature, and no administrators are set in the Galaxy configuration." ) + return trans.show_error_message( "You must be logged in as an administrator to access this feature, but no administrators are set in the Galaxy configuration." ) user = trans.get_user() if not user: - return trans.show_error_message( "You must be an administrator to access this feature, and currently you are not logged in." ) + return trans.show_error_message( "You must be logged in as an administrator to access this feature." ) if not user.email in admin_users: return trans.show_error_message( "You must be an administrator to access this feature." ) return func( self, trans, *args, **kwargs ) @@ -264,6 +264,7 @@ class UniverseWebTransaction( base.DefaultWebTransaction ): url_for( controller='user', action='login' ), url_for( controller='user', action='create' ), url_for( controller='user', action='reset_password' ), + url_for( controller='library', action='browse' ) ) if self.galaxy_session.user is None and environ['PATH_INFO'] not in allowed_paths: self.response.send_redirect( url_for( controller='root', action='index' ) ) diff --git a/test/functional/test_security_and_libraries.py b/test/functional/test_security_and_libraries.py index ae154e79770..df0af3dedf8 100644 --- a/test/functional/test_security_and_libraries.py +++ b/test/functional/test_security_and_libraries.py @@ -2,7 +2,7 @@ import galaxy.model from galaxy.model.orm import * from base.twilltestcase import * -not_logged_in_security_msg = 'You must be an administrator to access this feature, and currently you are not logged in.' +not_logged_in_security_msg = 'You must be logged in as an administrator to access this feature.' logged_in_security_msg = 'You must be an administrator to access this feature.' class TestHistory( TwillTestCase ): diff --git a/tools/data_source/access_libraries.xml b/tools/data_source/access_libraries.xml index 1281386f7ce..d843e9ae52e 100644 --- a/tools/data_source/access_libraries.xml +++ b/tools/data_source/access_libraries.xml @@ -1,7 +1,7 @@ - stored locally - - - + stored locally + + +