From 56ed50400f94a04e88c3a6a09721903d571dc969 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 13 Sep 2018 14:50:56 +0200 Subject: [PATCH] Sort rval so that newest tool appears last in rval --- lib/galaxy/tools/toolbox/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/tools/toolbox/base.py b/lib/galaxy/tools/toolbox/base.py index 034b7944bd5..34a131e6a7f 100644 --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -446,6 +446,9 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): for tool in self._tools_by_id.values(): if tool.old_id == tool_id: rval.append(tool) + # if we don't have a lineage_map for this tool we need to sort by version, + # so that the last tool in rval is the newest tool. + rval.sort(key=lambda t: t.version) if rval: if get_all_versions: return rval