Skip to content

Commit 5efcc5f

Browse files
committed
Fix revision augmentation so events after RFC publication gets a "RFC"
designation - Legacy-Id: 5286
1 parent c0ecb78 commit 5efcc5f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ietf/doc/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ def augment_events_with_revision(doc, events):
130130

131131
event_revisions = list(NewRevisionDocEvent.objects.filter(doc=doc).order_by('time', 'id').values('id', 'rev', 'time'))
132132

133-
cur_rev = doc.rev
134-
if doc.get_state_slug() == "rfc":
135-
cur_rev = "RFC"
133+
if doc.type_id == "draft" and doc.get_state_slug() == "rfc":
134+
# add fake "RFC" revision
135+
e = doc.latest_event(type="published_rfc")
136+
if e:
137+
event_revisions.append(dict(id=e.id, time=e.time, rev="RFC"))
138+
event_revisions.sort(key=lambda x: (x["time"], x["id"]))
136139

137140
for e in sorted(events, key=lambda e: (e.time, e.id), reverse=True):
138141
while event_revisions and (e.time, e.id) < (event_revisions[-1]["time"], event_revisions[-1]["id"]):

0 commit comments

Comments
 (0)