Skip to content

Commit 3763c49

Browse files
committed
Some draft revisions can exist multiple times in the crawl history? Filter them.
- Legacy-Id: 10604
1 parent cf49640 commit 3763c49

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ietf/doc/utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,4 +577,11 @@ def ancestors(doc):
577577
'published': e.time.isoformat(),
578578
'url': urlreverse("doc_view", kwargs=dict(name=e.doc))
579579
})
580-
return sorted(retval, key=lambda x: x['published'])
580+
# for some reason, some draft revisions can exist multiple times?
581+
seen = set()
582+
unique = []
583+
for r in retval:
584+
if r["url"] not in seen:
585+
unique.append(r)
586+
seen.add(r["url"])
587+
return sorted(unique, key=lambda x: x['published'])

0 commit comments

Comments
 (0)