Skip to content

Commit 71fee2a

Browse files
committed
Merged in [10834] from housley@vigilsec.com:
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: 10837 Note: SVN reference [10834] has been migrated to Git commit 6cf8680
2 parents 8ae4afb + 6cf8680 commit 71fee2a

7 files changed

Lines changed: 176 additions & 114 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: 122 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -264,41 +264,56 @@
264264
</tr>
265265
{% endif %}
266266

267-
<tr>
268-
<th></th>
269-
<th>Document shepherd</th>
270-
<td class="edit">
271-
{% if can_edit_stream_info %}
272-
<a class="btn btn-default btn-xs" href="{% url "doc_edit_shepherd" name=doc.name %}">Edit</a>
273-
{% elif is_shepherd %}
274-
<a class="btn btn-default btn-xs" href="{% url "doc_change_shepherd_email" name=doc.name %}">Change Email</a>
275-
{% endif %}
276-
</td>
277-
<td>
278-
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
279-
</td>
280-
</tr>
281-
282-
{% if shepherd_writeup or can_edit_shepherd_writeup %}
267+
{% if stream_state_type_slug == "draft-stream-ietf" %}
283268
<tr>
284269
<th></th>
285-
<th>Shepherd write-up</th>
270+
<th>Document shepherd</th>
286271
<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 %}
290-
<a class="btn btn-default btn-xs" href="{{doc_edit_url}}">Edit</a>
291-
{% endif %}
272+
{% if can_edit_stream_info %}
273+
<a class="btn btn-default btn-xs" href="{% url "doc_edit_shepherd" name=doc.name %}">Edit</a>
274+
{% elif is_shepherd %}
275+
<a class="btn btn-default btn-xs" href="{% url "doc_change_shepherd_email" name=doc.name %}">Change Email</a>
292276
{% endif %}
293277
</td>
294278
<td>
295-
{% if shepherd_writeup %}
296-
<a class="btn btn-default btn-xs" href="{% url "doc_shepherd_writeup" name=doc.name %}">Show</a>
297-
(last changed {{ shepherd_writeup.time|date:"Y-m-d"}})
298-
{% else %}
299-
(None)
279+
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
280+
</td>
281+
</tr>
282+
283+
{% if shepherd_writeup or can_edit_shepherd_writeup %}
284+
<tr>
285+
<th></th>
286+
<th>Shepherd write-up</th>
287+
<td class="edit">
288+
{% if can_edit_shepherd_writeup %}
289+
{% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %}
290+
{% if doc_edit_url %}
291+
<a class="btn btn-default btn-xs" href="{{doc_edit_url}}">Edit</a>
292+
{% endif %}
293+
{% endif %}
294+
</td>
295+
<td>
296+
{% if shepherd_writeup %}
297+
<a class="btn btn-default btn-xs" href="{% url "doc_shepherd_writeup" name=doc.name %}">Show</a>
298+
(last changed {{ shepherd_writeup.time|date:"Y-m-d"}})
299+
{% else %}
300+
(None)
301+
{% endif %}
302+
</td>
303+
</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>
300312
{% endif %}
301313
</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>
302317
</tr>
303318
{% endif %}
304319

@@ -310,105 +325,108 @@
310325
{% endif %}
311326

312327
</tbody>
313-
<tbody class="meta">
314-
<tr>
315-
<th>IESG</th>
316-
<th><a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iesg" %}">IESG state</a></th>
317-
<td class="edit">
318-
{% if iesg_state and can_edit %}
319-
<a class="btn btn-default btn-xs" href="{% url "doc_change_state" name=doc.name %}">Edit</a>
320-
{% endif %}
321-
</td>
322-
<td>
323-
{{ iesg_state_summary|default:"I-D Exists" }}
324-
</td>
325-
</tr>
326328

327-
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
329+
{% if not stream_state_type_slug == "draft-stream-iab" %}
330+
<tbody class="meta">
328331
<tr>
329-
<th></th>
330-
<th>Consensus</th>
332+
<th>IESG</th>
333+
<th><a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iesg" %}">IESG state</a></th>
331334
<td class="edit">
332-
{% if can_edit or can_edit_stream_info %}
333-
<a class="btn btn-default btn-xs" href="{% url "doc_edit_consensus" name=doc.name %}">Edit</a>
335+
{% if iesg_state and can_edit %}
336+
<a class="btn btn-default btn-xs" href="{% url "doc_change_state" name=doc.name %}">Edit</a>
334337
{% endif %}
335338
</td>
336339
<td>
337-
<span title="Whether the document is the result of a community consensus process as defined in RFC 5741">{{ consensus }}</span>
340+
{{ iesg_state_summary|default:"I-D Exists" }}
338341
</td>
339342
</tr>
340-
{% endif %}
341343

342-
<tr>
343-
<th></th>
344-
<th>Telechat date</th>
345-
<td class="edit">
346-
{% if can_edit %}
344+
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
345+
<tr>
346+
<th></th>
347+
<th>Consensus</th>
348+
<td class="edit">
349+
{% if can_edit or can_edit_stream_info %}
350+
<a class="btn btn-default btn-xs" href="{% url "doc_edit_consensus" name=doc.name %}">Edit</a>
351+
{% endif %}
352+
</td>
353+
<td>
354+
<span title="Whether the document is the result of a community consensus process as defined in RFC 5741">{{ consensus }}</span>
355+
</td>
356+
</tr>
357+
{% endif %}
358+
359+
<tr>
360+
<th></th>
361+
<th>Telechat date</th>
362+
<td class="edit">
363+
{% if can_edit %}
347364
<a class="btn btn-default btn-xs" href="{% url "doc_change_telechat_date" name=doc.name %}">Edit</a>
348-
{% endif %}
349-
</td>
350-
<td>
351-
{% if telechat %}
352-
On agenda of {{ telechat.telechat_date }} IESG telechat
353-
{% if telechat.returning_item %}
354-
(returning item)
355365
{% endif %}
356-
{% else %}
357-
{% if can_edit %}
358-
(None)
366+
</td>
367+
<td>
368+
{% if telechat %}
369+
On agenda of {{ telechat.telechat_date }} IESG telechat
370+
{% if telechat.returning_item %}
371+
(returning item)
372+
{% endif %}
373+
{% else %}
374+
{% if can_edit %}
375+
(None)
376+
{% endif %}
359377
{% endif %}
360-
{% endif %}
361378

362-
{% if ballot_summary %}
363-
<br><i>{{ ballot_summary }}</i>
364-
{% endif %}
365-
</td>
366-
</tr>
379+
{% if ballot_summary %}
380+
<br><i>{{ ballot_summary }}</i>
381+
{% endif %}
382+
</td>
383+
</tr>
367384

368-
<tr>
369-
<th></th>
370-
<th>Responsible AD</th>
371-
<td class="edit">
372-
{% if can_edit %}
373-
<a class="btn btn-default btn-xs" href="{% url "doc_change_ad" name=doc.name %}">Edit</a>
374-
{% endif %}
375-
</td>
376-
<td>
377-
{{ doc.ad|default:"(None)" }}
378-
</td>
379-
</tr>
385+
<tr>
386+
<th></th>
387+
<th>Responsible AD</th>
388+
<td class="edit">
389+
{% if can_edit %}
390+
<a class="btn btn-default btn-xs" href="{% url "doc_change_ad" name=doc.name %}">Edit</a>
391+
{% endif %}
392+
</td>
393+
<td>
394+
{{ doc.ad|default:"(None)" }}
395+
</td>
396+
</tr>
380397

381-
{% if iesg_state %}
382-
{% if doc.note or can_edit %}
383-
<tr>
384-
<th></th>
385-
<th>IESG note</th>
386-
<td class="edit">
387-
{% if can_edit %}
388-
<a class="btn btn-default btn-xs" href="{% url "doc_change_iesg_note" name=doc.name %}">Edit</a>
389-
{% endif %}
398+
{% if iesg_state %}
399+
{% if doc.note or can_edit %}
400+
<tr>
401+
<th></th>
402+
<th>IESG note</th>
403+
<td class="edit">
404+
{% if can_edit %}
405+
<a class="btn btn-default btn-xs" href="{% url "doc_change_iesg_note" name=doc.name %}">Edit</a>
406+
{% endif %}
390407
</td>
391408
<td>
392-
{{ doc.note|default:"(None)"|linebreaksbr }}
409+
{{ doc.note|default:"(None)"|linebreaksbr }}
393410
</td>
394411
</tr>
412+
{% endif %}
395413
{% endif %}
396-
{% endif %}
397414

398-
<tr>
399-
<th></th>
400-
<th>Send notices to</th>
401-
<td class="edit">
402-
{% if can_edit_notify %}
403-
<a class="btn btn-default btn-xs" href="{% url "doc_change_notify" name=doc.name %}">Edit</a>
404-
{% endif %}
405-
</td>
406-
<td>
407-
{{ doc.notify|default:"(None)"}}
408-
</td>
409-
</tr>
415+
<tr>
416+
<th></th>
417+
<th>Send notices to</th>
418+
<td class="edit">
419+
{% if can_edit_notify %}
420+
<a class="btn btn-default btn-xs" href="{% url "doc_change_notify" name=doc.name %}">Edit</a>
421+
{% endif %}
422+
</td>
423+
<td>
424+
{{ doc.notify|default:"(None)"}}
425+
</td>
426+
</tr>
410427

411-
</tbody>
428+
</tbody>
429+
{% endif %}
412430

413431
{% if iana_review_state %}
414432
<tbody class="meta">

0 commit comments

Comments
 (0)