From df84098980982b1ebf57b0b4f2371c2ccac68b22 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 19 Jun 2016 12:52:36 +0000 Subject: [PATCH] Fixed a bug in find-history-replacement-active-at() where multiple history entries with the same timestamp would be unordered. This led to the wrong historic group info being shown in some cases (e.g., meeting/86/agenda would show dmmnew instead of dmm, leading to wrong agenda links) - Legacy-Id: 11410 --- ietf/utils/history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/utils/history.py b/ietf/utils/history.py index fe376cbed..143cdcc6d 100644 --- a/ietf/utils/history.py +++ b/ietf/utils/history.py @@ -42,7 +42,7 @@ def find_history_replacements_active_at(objects, time): # through SQL we just grab all of them and sort it out ourselves changed_objects = [o for o in objects if o.time > time] - histories = history_model.objects.filter(**{ relation_name + "__in": changed_objects }).order_by(relation_name, "-time") + histories = history_model.objects.filter(**{ relation_name + "__in": changed_objects }).order_by(relation_name, "-time", "-id") history_for_obj = { o.pk: o for o in objects } skip = None