Sort rval so that newest tool appears last in rval

This commit is contained in:
mvdbeek
2018-09-13 14:51:03 +02:00
parent f8430b110d
commit 56ed50400f
+3
View File
@@ -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