Skip to content

Commit fc0c605

Browse files
committed
Merged [7590] from rjsparks@nostrum.com: Change when the consensus field is displayed and who can edit it for IETF stream documents. Fixes bug ietf-tools#1380.
- Legacy-Id: 7612 Note: SVN reference [7590] has been migrated to Git commit 85458ab
1 parent 1d9e9e7 commit fc0c605

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,18 @@ def document_main(request, name, rev=None):
262262

263263
can_edit_stream_info = is_authorized_in_doc_stream(request.user, doc)
264264
can_edit_shepherd_writeup = can_edit_stream_info or user_is_person(request.user, doc.shepherd) or has_role(request.user, ["Area Director"])
265+
can_edit_consensus = False
265266

266267
consensus = None
267-
if doc.stream_id in ("ietf", "irtf", "iab"):
268+
if doc.stream_id == "ietf" and iesg_state:
269+
show_in_states = set(IESG_BALLOT_ACTIVE_STATES)
270+
show_in_states.update(('approved','ann','rfcqueue','pub'))
271+
if iesg_state.slug in show_in_states:
272+
can_edit_consensus = can_edit
273+
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
274+
consensus = nice_consensus(e and e.consensus)
275+
elif doc.stream_id in ("irtf", "iab"):
276+
can_edit_consensus = can_edit or can_edit_stream_info
268277
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
269278
consensus = nice_consensus(e and e.consensus)
270279

@@ -339,6 +348,7 @@ def document_main(request, name, rev=None):
339348
can_edit_stream_info=can_edit_stream_info,
340349
can_edit_shepherd_writeup=can_edit_shepherd_writeup,
341350
can_edit_iana_state=can_edit_iana_state,
351+
can_edit_consensus=can_edit_consensus,
342352

343353
rfc_number=rfc_number,
344354
draft_name=draft_name,

ietf/templates/doc/document_draft.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<tr>
122122
<td>Consensus:</td>
123123
<td>
124-
<a title="Whether the document is the result of a community consensus process as defined in RFC 5741" {% if can_edit or can_edit_stream_info %}class="editlink" href="{% url "doc_edit_consensus" name=doc.name %}"{% endif %}>
124+
<a title="Whether the document is the result of a community consensus process as defined in RFC 5741" {% if can_edit_consensus %}class="editlink" href="{% url "doc_edit_consensus" name=doc.name %}"{% endif %}>
125125
{{ consensus }}
126126
</a>
127127
</td>

0 commit comments

Comments
 (0)