Skip to content

Commit 0fa8800

Browse files
committed
Rewrote some code in document_main to avoid using the iesg_state.slug attribute when iesg_state might not be set.
- Legacy-Id: 18469
1 parent 392a38f commit 0fa8800

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def document_main(request, name, rev=None):
174174
split_content = not ( request.GET.get('include_text') or request.COOKIES.get("full_draft", settings.USER_PREFERENCE_DEFAULTS["full_draft"]) == "on" )
175175

176176
iesg_state = doc.get_state("draft-iesg")
177+
iesg_state_slug = iesg_state.slug if iesg_state else None
177178
iesg_state_summary = doc.friendly_state()
178179
irsg_state = doc.get_state("draft-stream-irtf")
179180

@@ -272,7 +273,7 @@ def document_main(request, name, rev=None):
272273
iesg_ballot_summary = None
273274
irsg_ballot_summary = None
274275
due_date = None
275-
if (iesg_state and iesg_state.slug in IESG_BALLOT_ACTIVE_STATES) or irsg_state:
276+
if (iesg_state_slug in IESG_BALLOT_ACTIVE_STATES) or irsg_state:
276277
active_ballot = doc.active_ballot()
277278
if active_ballot:
278279
if irsg_state:
@@ -326,7 +327,7 @@ def document_main(request, name, rev=None):
326327
if doc.stream_id == "ietf" and iesg_state:
327328
show_in_states = set(IESG_BALLOT_ACTIVE_STATES)
328329
show_in_states.update(('approved','ann','rfcqueue','pub'))
329-
if iesg_state.slug in show_in_states:
330+
if iesg_state_slug in show_in_states:
330331
can_edit_consensus = can_edit
331332
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
332333
consensus = nice_consensus(e and e.consensus)
@@ -403,14 +404,14 @@ def document_main(request, name, rev=None):
403404
label = "Request Publication"
404405
if not doc.intended_std_level:
405406
label += " (note that intended status is not set)"
406-
if iesg_state and iesg_state.slug not in ('idexists','dead'):
407+
if iesg_state and iesg_state_slug not in ('idexists','dead'):
407408
label += " (Warning: the IESG state indicates ongoing IESG processing)"
408409
actions.append((label, urlreverse('ietf.doc.views_draft.request_publication', kwargs=dict(name=doc.name))))
409410

410411
if doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ietf",) and not snapshot:
411-
if iesg_state.slug == 'idexists' and can_edit:
412+
if iesg_state_slug == 'idexists' and can_edit:
412413
actions.append(("Begin IESG Processing", urlreverse('ietf.doc.views_draft.edit_info', kwargs=dict(name=doc.name)) + "?new=1"))
413-
elif can_edit_stream_info and (iesg_state.slug in ('idexists','watching')):
414+
elif can_edit_stream_info and (iesg_state_slug in ('idexists','watching')):
414415
actions.append(("Submit to IESG for Publication", urlreverse('ietf.doc.views_draft.to_iesg', kwargs=dict(name=doc.name))))
415416

416417
augment_docs_and_user_with_user_info([doc], request.user)

0 commit comments

Comments
 (0)