commit/galaxy-central: dan: Fix for tool shed get_category_by_name when category does not exist.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/6fa63ee539a7/ changeset: 6fa63ee539a7 user: dan date: 2012-10-16 18:20:05 summary: Fix for tool shed get_category_by_name when category does not exist. affected #: 1 file diff -r 3b292aa60eae153e4c162df30221b9d28bc26017 -r 6fa63ee539a7d6fb32693509808e035bd7a05dff lib/galaxy/webapps/community/controllers/common.py --- a/lib/galaxy/webapps/community/controllers/common.py +++ b/lib/galaxy/webapps/community/controllers/common.py @@ -378,7 +378,10 @@ return trans.sa_session.query( trans.model.Category ).get( trans.security.decode_id( id ) ) def get_category_by_name( trans, name ): """Get a category from the database via name""" - return trans.sa_session.query( trans.model.Category ).filter_by( name=name ).one() + try: + return trans.sa_session.query( trans.model.Category ).filter_by( name=name ).one() + except sqlalchemy.orm.exc.NoResultFound: + return None def get_categories( trans ): """Get all categories from the database""" return trans.sa_session.query( trans.model.Category ) \ 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