From 7e67368424a718f2e156b961aaf0a1a9672df9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gr=C3=BCning?= Date: Sun, 15 Nov 2015 00:33:53 +0100 Subject: [PATCH] Don't fail if a repository is already installed If an repository is already installed `installed_tool_shed_repositories` is None and this does not work with map. --- lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py index 7fba23d9ce2..d3627565091 100644 --- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py +++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py @@ -250,8 +250,10 @@ class ToolShedRepositoriesController( BaseAPIController ): action='show', id=trans.security.encode_id( tool_shed_repository.id ) ) return tool_shed_repository_dict - - return map( to_dict, installed_tool_shed_repositories ) + if installed_tool_shed_repositories: + return map( to_dict, installed_tool_shed_repositories ) + message = "No repositories were installed, possibly because the selected repository has already been installed." + return dict( status="ok", message=message ) @expose_api def install_repository_revisions( self, trans, payload, **kwd ):