commit/galaxy-central: greg: Fixes for managing the tool dependencies of an installed tool shed repository.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2c257f0cbeb8/ Changeset: 2c257f0cbeb8 User: greg Date: 2013-07-19 19:57:31 Summary: Fixes for managing the tool dependencies of an installed tool shed repository. Affected #: 3 files diff -r 25a0393e91120b4e0fa79b868f5fafc8ea14843b -r 2c257f0cbeb8a09e9b04a67ae59bf68a46e650e9 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -653,9 +653,15 @@ message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) - # We need a tool_shed_repository, so get it from one of the tool_dependencies. - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) - tool_shed_repository = tool_dependency.tool_shed_repository + if tool_dependency_ids: + # We need a tool_shed_repository, so get it from one of the tool_dependencies. + tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) + tool_shed_repository = tool_dependency.tool_shed_repository + else: + # The user must be on the manage_repository_tool_dependencies page and clicked the button to either install or uninstall a + # tool dependency, but they didn't check any of the available tool dependencies on which to perform the action. + repository_id = kwd.get( 'repository_id', None ) + tool_shed_repository = suc.get_tool_shed_repository_by_id( trans, repository_id ) if 'operation' in kwd: operation = kwd[ 'operation' ].lower() if not tool_dependency_ids: @@ -664,7 +670,7 @@ kwd[ 'status' ] = 'error' del kwd[ 'operation' ] return trans.response.send_redirect( web.url_for( controller='admin_toolshed', - action='manage_installed_tool_dependencies', + action='manage_repository_tool_dependencies', **kwd ) ) if operation == 'browse': return trans.response.send_redirect( web.url_for( controller='admin_toolshed', @@ -720,7 +726,7 @@ @web.expose @web.require_admin def manage_tool_dependencies( self, trans, **kwd ): - # This method is called when tool dependencies are being installed. See the related manage_repository_tool-dependencies + # This method is called when tool dependencies are being installed. See the related manage_repository_tool_dependencies # method for managing the tool dependencies for a specified installed tool shed repository. message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) diff -r 25a0393e91120b4e0fa79b868f5fafc8ea14843b -r 2c257f0cbeb8a09e9b04a67ae59bf68a46e650e9 templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako --- a/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako +++ b/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako @@ -44,7 +44,7 @@ <tr><td> %if tool_dependency.status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]: - <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ) )}"> + <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ), repository_id=trans.security.encode_id( repository.id ) )}"> ${tool_dependency.name} </a> %else: @@ -60,7 +60,7 @@ </table> %if can_install: <br/> - <form name="install_tool_dependencies" id="install_tool_dependencies" action="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='install' )}" method="post" > + <form name="install_tool_dependencies" id="install_tool_dependencies" action="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='install', repository_id=trans.security.encode_id( repository.id ) )}" method="post" ><div class="form-row"> Check each tool dependency that you want to install and click <b>Install</b>. </div> @@ -81,7 +81,7 @@ %endif %if can_uninstall: <br/> - <form name="uninstall_tool_dependencies" id="uninstall_tool_dependencies" action="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='uninstall' )}" method="post" > + <form name="uninstall_tool_dependencies" id="uninstall_tool_dependencies" action="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='uninstall', repository_id=trans.security.encode_id( repository.id ) )}" method="post" ><div class="form-row"> Check each tool dependency that you want to uninstall and click <b>Uninstall</b>. </div> diff -r 25a0393e91120b4e0fa79b868f5fafc8ea14843b -r 2c257f0cbeb8a09e9b04a67ae59bf68a46e650e9 templates/admin/tool_shed_repository/repository_actions_menu.mako --- a/templates/admin/tool_shed_repository/repository_actions_menu.mako +++ b/templates/admin/tool_shed_repository/repository_actions_menu.mako @@ -32,7 +32,7 @@ <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a> %endif %if tool_dependency_ids: - <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', tool_dependency_ids=tool_dependency_ids, repository_id=trans.security.encode_id( repository.id ) )}">Manage tool dependencies</a> %endif <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a> %endif 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)
-
commits-noreply@bitbucket.org