Skip to content

Commit 4bbe2fe

Browse files
committed
Restricted a log.assertion to only run for current documents (not DocHistory entries). Fixed a buggy handling of document.group for historic groups.
- Legacy-Id: 18617
1 parent eaf9546 commit 4bbe2fe

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def document_main(request, name, rev=None):
138138

139139
snapshot = False
140140

141+
gh = None
141142
if rev != None:
142143
if rev == doc.rev:
143144
return redirect('ietf.doc.views_doc.document_main', name=name)
@@ -155,11 +156,12 @@ def document_main(request, name, rev=None):
155156
if doc.type_id == "charter":
156157
# find old group, too
157158
gh = find_history_active_at(doc.group, doc.time)
158-
if gh:
159-
group = gh
160159

161160
# set this after we've found the right doc instance
162-
group = doc.group
161+
if gh:
162+
group = gh
163+
else:
164+
group = doc.group
163165

164166
top = render_document_top(request, doc, "status", name)
165167

@@ -174,7 +176,8 @@ def document_main(request, name, rev=None):
174176
split_content = not ( request.GET.get('include_text') or request.COOKIES.get("full_draft", settings.USER_PREFERENCE_DEFAULTS["full_draft"]) == "on" )
175177

176178
iesg_state = doc.get_state("draft-iesg")
177-
log.assertion('iesg_state', note="A document's 'draft-iesg' state should never be unset'. Failed for %s"%doc.name)
179+
if isinstance(doc, Document):
180+
log.assertion('iesg_state', note="A document's 'draft-iesg' state should never be unset'. Failed for %s"%doc.name)
178181
iesg_state_slug = iesg_state.slug if iesg_state else None
179182
iesg_state_summary = doc.friendly_state()
180183
irsg_state = doc.get_state("draft-stream-irtf")

0 commit comments

Comments
 (0)