Skip to content

Commit 933134f

Browse files
committed
Don't show the request publication button for ise,irtf, and iab drafts after publication has already been requested. Fixes ietf-tools#2019. Commit ready for merge.
- Legacy-Id: 12104
1 parent 5b32cc2 commit 933134f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

ietf/doc/tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,11 @@ def test_document_nonietf_pubreq_button(self):
804804
self.assertEqual(r.status_code, 200)
805805
self.assertTrue("Request publication" in unicontent(r))
806806

807+
doc.states.add(State.objects.get(type_id='draft-stream-iab',slug='rfc-edit'))
808+
r = self.client.get(urlreverse("doc_view", kwargs=dict(name=doc.name)))
809+
self.assertEqual(r.status_code, 200)
810+
self.assertTrue("Request publication" not in unicontent(r))
811+
807812

808813
class AddCommentTestCase(TestCase):
809814
def test_add_comment(self):

ietf/doc/views_doc.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,13 @@ def document_main(request, name, rev=None):
334334

335335
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("iab", "ise", "irtf")
336336
and can_edit_stream_info and not snapshot):
337-
label = "Request Publication"
338-
if not doc.intended_std_level:
339-
label += " (note that intended status is not set)"
340-
if iesg_state and iesg_state.slug != 'dead':
341-
label += " (Warning: the IESG state indicates ongoing IESG processing)"
342-
actions.append((label, urlreverse('doc_request_publication', kwargs=dict(name=doc.name))))
337+
if doc.get_state_slug('draft-stream-%s' % doc.stream_id) not in ('rfc-edit', 'pub', 'dead'):
338+
label = "Request Publication"
339+
if not doc.intended_std_level:
340+
label += " (note that intended status is not set)"
341+
if iesg_state and iesg_state.slug != 'dead':
342+
label += " (Warning: the IESG state indicates ongoing IESG processing)"
343+
actions.append((label, urlreverse('doc_request_publication', kwargs=dict(name=doc.name))))
343344

344345
if doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ietf",) and not snapshot:
345346
if not iesg_state and can_edit:

0 commit comments

Comments
 (0)