diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index da6a9a1f6..15e7b6ab4 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -804,6 +804,11 @@ class DocTestCase(TestCase): self.assertEqual(r.status_code, 200) self.assertTrue("Request publication" in unicontent(r)) + doc.states.add(State.objects.get(type_id='draft-stream-iab',slug='rfc-edit')) + r = self.client.get(urlreverse("doc_view", kwargs=dict(name=doc.name))) + self.assertEqual(r.status_code, 200) + self.assertTrue("Request publication" not in unicontent(r)) + class AddCommentTestCase(TestCase): def test_add_comment(self): diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index f64bd9723..a297c107a 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -334,12 +334,13 @@ def document_main(request, name, rev=None): if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("iab", "ise", "irtf") and can_edit_stream_info and not snapshot): - label = "Request Publication" - if not doc.intended_std_level: - label += " (note that intended status is not set)" - if iesg_state and iesg_state.slug != 'dead': - label += " (Warning: the IESG state indicates ongoing IESG processing)" - actions.append((label, urlreverse('doc_request_publication', kwargs=dict(name=doc.name)))) + if doc.get_state_slug('draft-stream-%s' % doc.stream_id) not in ('rfc-edit', 'pub', 'dead'): + label = "Request Publication" + if not doc.intended_std_level: + label += " (note that intended status is not set)" + if iesg_state and iesg_state.slug != 'dead': + label += " (Warning: the IESG state indicates ongoing IESG processing)" + actions.append((label, urlreverse('doc_request_publication', kwargs=dict(name=doc.name)))) if doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ietf",) and not snapshot: if not iesg_state and can_edit: