Skip to content

Commit 63f5af7

Browse files
committed
Guard against use of nonexistant attribute.
- Legacy-Id: 11166
1 parent d78a9a3 commit 63f5af7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/doc/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def get_ancestors(doc):
597597
'published': e.time.isoformat(),
598598
'url': url
599599
}
600-
if doc.history_set.filter(rev=e.newrevisiondocevent.rev).exists():
600+
if hasattr(e, 'newrevisiondocevent') and doc.history_set.filter(rev=e.newrevisiondocevent.rev).exists():
601601
history[url]['pages'] = doc.history_set.filter(rev=e.newrevisiondocevent.rev).first().pages
602602
history = history.values()
603603
return sorted(history, key=lambda x: x['published'])

0 commit comments

Comments
 (0)