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
This commit is contained in:
Henrik Levkowetz 2016-06-19 12:52:36 +00:00
parent b79ac1ee29
commit df84098980

View file

@ -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