Skip to content

Commit 6cf8680

Browse files
committed
Allow IAB, IRTF, and Independent streams to use new capability for RFC Editor Notes. Do not display of document shepherd and shepherd writeup for non-IETF stream documents. Do not display IESG information for IAB stream documents.
- Legacy-Id: 10834
1 parent 8b87125 commit 6cf8680

7 files changed

Lines changed: 109 additions & 48 deletions

File tree

ietf/doc/mails.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,17 @@ def generate_publication_request(request, doc):
243243
approving_body = str(doc.stream)
244244
consensus_body = approving_body
245245

246+
e = doc.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
247+
rfcednote = e.text if e else ""
248+
246249
return render_to_string("doc/mail/publication_request.txt",
247250
dict(doc=doc,
248251
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
249252
group_description=group_description,
250253
approving_body=approving_body,
251254
consensus_body=consensus_body,
252255
consensus=consensus,
256+
rfc_editor_note=rfcednote,
253257
)
254258
)
255259

ietf/doc/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ def active_ballot(self):
234234

235235
def has_rfc_editor_note(self):
236236
e = self.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
237-
return bool(e and (e.text != ""))
237+
if e and (e.text != ""):
238+
return e.time
239+
else:
240+
return False
238241

239242
def meeting_related(self):
240243
answer = False

ietf/doc/tests_ballot.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,49 @@ def verify_can_see(username, url):
421421
e.text = u"Test note to the RFC Editor text."
422422
e.save()
423423

424+
# IETF Stream Documents
424425
for p in ['doc_ballot_approvaltext','doc_ballot_writeupnotes','doc_ballot_rfceditornote']:
425426
url = urlreverse(p, kwargs=dict(name=draft.name))
426427

427-
for username in ['plain','marschairman','iana','iab chair']:
428+
for username in ['plain','marschairman','iab chair','irtf chair','ise','iana']:
428429
verify_fail(username, url)
429430

430431
for username in ['secretary','ad']:
431432
verify_can_see(username, url)
432433

434+
# RFC Editor Notes for documents in the IAB Stream
435+
draft.stream_id = 'iab'
436+
draft.save()
437+
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
438+
439+
for username in ['plain','marschairman','ad','irtf chair','ise','iana']:
440+
verify_fail(username, url)
441+
442+
for username in ['secretary','iab chair']:
443+
verify_can_see(username, url)
444+
445+
# RFC Editor Notes for documents in the IRTF Stream
446+
draft.stream_id = 'irtf'
447+
draft.save()
448+
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
449+
450+
for username in ['plain','marschairman','ad','iab chair','ise','iana']:
451+
verify_fail(username, url)
452+
453+
for username in ['secretary','irtf chair']:
454+
verify_can_see(username, url)
455+
456+
# RFC Editor Notes for documents in the IAB Stream
457+
draft.stream_id = 'ise'
458+
draft.save()
459+
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
460+
461+
for username in ['plain','marschairman','ad','iab chair','irtf chair','iana']:
462+
verify_fail(username, url)
463+
464+
for username in ['secretary','ise']:
465+
verify_can_see(username, url)
466+
433467
class ApproveBallotTests(TestCase):
434468
def test_approve_ballot(self):
435469
draft = make_test_data()

ietf/doc/views_ballot.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
generate_approval_mail )
2424
from ietf.doc.lastcall import request_last_call
2525
from ietf.iesg.models import TelechatDate
26-
from ietf.ietfauth.utils import has_role, role_required
26+
from ietf.ietfauth.utils import has_role, role_required, is_authorized_in_doc_stream
2727
from ietf.message.utils import infer_message
2828
from ietf.name.models import BallotPositionName
2929
from ietf.person.models import Person
@@ -592,15 +592,16 @@ class BallotRfcEditorNoteForm(forms.Form):
592592
def clean_rfc_editor_note(self):
593593
return self.cleaned_data["rfc_editor_note"].replace("\r", "")
594594

595-
@role_required('Area Director','Secretariat')
595+
@role_required('Area Director','Secretariat','IAB Chair','IRTF Chair','ISE')
596596
def ballot_rfceditornote(request, name):
597-
"""Editing of RFC Editor Note in the ballot"""
597+
"""Editing of RFC Editor Note"""
598598
doc = get_object_or_404(Document, docalias__name=name)
599599

600-
login = request.user.person
600+
if not is_authorized_in_doc_stream(request.user, doc):
601+
return HttpResponseForbidden("You do not have the necessary permissions to change the RFC Editor Note for this document")
601602

603+
login = request.user.person
602604

603-
604605
existing = doc.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
605606
if not existing or (existing.text == ""):
606607
existing = generate_ballot_rfceditornote(request, doc)

ietf/templates/doc/ballot/rfceditornote.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
{% load bootstrap3 %}
66

7-
{% block title %}RFC Editor Note for ballot for {{ doc }}{% endblock %}
7+
{% block title %}RFC Editor Note for {{ doc }}{% endblock %}
88

99
{% block content %}
1010
{% origin %}
1111

12-
<h1>RFC Editor Note for ballot<br><small><a href="{% url "doc_view" name=doc.canonical_name %}">{{ doc }}</a></small></h1>
12+
<h1>RFC Editor Note for<br><small><a href="{% url "doc_view" name=doc.canonical_name %}">{{ doc }}</a></small></h1>
1313

1414
{% bootstrap_messages %}
1515

ietf/templates/doc/document_draft.html

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -264,42 +264,56 @@
264264
</tr>
265265
{% endif %}
266266

267+
{% if stream_state_type_slug == "draft-stream-ietf" %}
267268
<tr>
268269
<th></th>
269270
<th>Document shepherd</th>
270271
<td class="edit">
271-
{% if can_edit_stream_info %}
272+
{% if can_edit_stream_info %}
272273
<a class="btn btn-default btn-xs" href="{% url "doc_edit_shepherd" name=doc.name %}">Edit</a>
273-
{% elif is_shepherd %}
274+
{% elif is_shepherd %}
274275
<a class="btn btn-default btn-xs" href="{% url "doc_change_shepherd_email" name=doc.name %}">Change Email</a>
275-
{% endif %}
276+
{% endif %}
276277
</td>
277278
<td>
278-
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
279+
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
279280
</td>
280281
</tr>
281282

282-
{% if shepherd_writeup or can_edit_shepherd_writeup %}
283+
{% if shepherd_writeup or can_edit_shepherd_writeup %}
283284
<tr>
284285
<th></th>
285286
<th>Shepherd write-up</th>
286287
<td class="edit">
287-
{% if can_edit_shepherd_writeup %}
288-
{% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %}
289-
{% if doc_edit_url %}
288+
{% if can_edit_shepherd_writeup %}
289+
{% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %}
290+
{% if doc_edit_url %}
290291
<a class="btn btn-default btn-xs" href="{{doc_edit_url}}">Edit</a>
292+
{% endif %}
291293
{% endif %}
292-
{% endif %}
293294
</td>
294295
<td>
295-
{% if shepherd_writeup %}
296+
{% if shepherd_writeup %}
296297
<a class="btn btn-default btn-xs" href="{% url "doc_shepherd_writeup" name=doc.name %}">Show</a>
297298
(last changed {{ shepherd_writeup.time|date:"Y-m-d"}})
298-
{% else %}
299+
{% else %}
299300
(None)
300-
{% endif %}
301+
{% endif %}
301302
</td>
302303
</tr>
304+
{% endif %}
305+
{% else %}
306+
<tr>
307+
<th></th>
308+
<th>RFC Editor Note</th>
309+
<td class="edit">
310+
{% if can_edit_stream_info %}
311+
<a class="btn btn-default btn-xs" href="{% url "doc_ballot_rfceditornote" name=doc.name %}">Edit</a>
312+
{% endif %}
313+
</td>
314+
<td>
315+
{% if doc.has_rfc_editor_note %}(last changed {{ doc.has_rfc_editor_note|date:"Y-m-d"}}){% else %}(None){% endif %}
316+
</td>
303317
{% endif %}
304318

305319
{% if published and started_iesg_process and published.time < started_iesg_process.time %}
@@ -310,89 +324,91 @@
310324
{% endif %}
311325

312326
</tbody>
327+
328+
{% if not stream_state_type_slug == "draft-stream-iab" %}
313329
<tbody class="meta">
314330
<tr>
315331
<th>IESG</th>
316332
<th><a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iesg" %}">IESG state</a></th>
317333
<td class="edit">
318-
{% if iesg_state and can_edit %}
334+
{% if iesg_state and can_edit %}
319335
<a class="btn btn-default btn-xs" href="{% url "doc_change_state" name=doc.name %}">Edit</a>
320-
{% endif %}
336+
{% endif %}
321337
</td>
322338
<td>
323-
{{ iesg_state_summary|default:"I-D Exists" }}
339+
{{ iesg_state_summary|default:"I-D Exists" }}
324340
</td>
325341
</tr>
326342

327-
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
343+
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
328344
<tr>
329345
<th></th>
330346
<th>Consensus</th>
331347
<td class="edit">
332-
{% if can_edit or can_edit_stream_info %}
348+
{% if can_edit or can_edit_stream_info %}
333349
<a class="btn btn-default btn-xs" href="{% url "doc_edit_consensus" name=doc.name %}">Edit</a>
334-
{% endif %}
350+
{% endif %}
335351
</td>
336352
<td>
337353
<span title="Whether the document is the result of a community consensus process as defined in RFC 5741">{{ consensus }}</span>
338354
</td>
339355
</tr>
340-
{% endif %}
356+
{% endif %}
341357

342358
<tr>
343359
<th></th>
344360
<th>Telechat date</th>
345361
<td class="edit">
346-
{% if can_edit %}
362+
{% if can_edit %}
347363
<a class="btn btn-default btn-xs" href="{% url "doc_change_telechat_date" name=doc.name %}">Edit</a>
348-
{% endif %}
364+
{% endif %}
349365
</td>
350366
<td>
351-
{% if telechat %}
367+
{% if telechat %}
352368
On agenda of {{ telechat.telechat_date }} IESG telechat
353-
{% if telechat.returning_item %}
369+
{% if telechat.returning_item %}
354370
(returning item)
355-
{% endif %}
356-
{% else %}
357-
{% if can_edit %}
371+
{% endif %}
372+
{% else %}
373+
{% if can_edit %}
358374
(None)
375+
{% endif %}
359376
{% endif %}
360-
{% endif %}
361377

362-
{% if ballot_summary %}
378+
{% if ballot_summary %}
363379
<br><i>{{ ballot_summary }}</i>
364-
{% endif %}
380+
{% endif %}
365381
</td>
366382
</tr>
367383

368384
<tr>
369385
<th></th>
370386
<th>Responsible AD</th>
371387
<td class="edit">
372-
{% if can_edit %}
388+
{% if can_edit %}
373389
<a class="btn btn-default btn-xs" href="{% url "doc_change_ad" name=doc.name %}">Edit</a>
374-
{% endif %}
390+
{% endif %}
375391
</td>
376392
<td>
377-
{{ doc.ad|default:"(None)" }}
393+
{{ doc.ad|default:"(None)" }}
378394
</td>
379395
</tr>
380396

381-
{% if iesg_state %}
382-
{% if doc.note or can_edit %}
397+
{% if iesg_state %}
398+
{% if doc.note or can_edit %}
383399
<tr>
384400
<th></th>
385401
<th>IESG note</th>
386402
<td class="edit">
387-
{% if can_edit %}
403+
{% if can_edit %}
388404
<a class="btn btn-default btn-xs" href="{% url "doc_change_iesg_note" name=doc.name %}">Edit</a>
389-
{% endif %}
405+
{% endif %}
390406
</td>
391407
<td>
392-
{{ doc.note|default:"(None)"|linebreaksbr }}
408+
{{ doc.note|default:"(None)"|linebreaksbr }}
393409
</td>
394410
</tr>
395-
{% endif %}
411+
{% endif %}
396412
{% endif %}
397413

398414
<tr>
@@ -409,6 +425,7 @@
409425
</tr>
410426

411427
</tbody>
428+
{% endif %}
412429

413430
{% if iana_review_state %}
414431
<tbody class="meta">

ietf/templates/doc/mail/publication_request.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This document is the product of the {{ group_description }}.{% endif %}{% endfil
77

88
URL: {{ doc_url }}
99

10-
{% filter wordwrap:73 %}{% if consensus != None %}The document {% if consensus %}represents{% else %}does not necessarily represent{% endif%} the consensus of the {{ consensus_body }}.
10+
{% filter wordwrap:73 %}{% if consensus != None %}The document {% if consensus %}represents{% else %}does not necessarily represent{% endif %} the consensus of the {{ consensus_body }}.
1111

1212
{% endif %}No IANA allocation in the document requires IETF Consensus or Standards Action.{% endfilter %}
1313

@@ -17,4 +17,6 @@ URL: {{ doc_url }}
1717
[OPTIONAL: Include statement of the purpose of publishing this document, its intended audience, its merits and significance.]
1818

1919
[OPTIONAL: Include suggested names and contact information for one or more competent and independent potential reviewers for the document (this can speed the review and approval process).]
20+
21+
{% if doc.has_rfc_editor_note %}{% filter wordwrap:73 %}{{ rfc_editor_note }}{% endfilter %}{% endif %}
2022
{% endautoescape %}

0 commit comments

Comments
 (0)