Don't show the request publication button for ise,irtf, and iab drafts after publication has already been requested. Fixes #2019. Commit ready for merge.

- Legacy-Id: 12104
This commit is contained in:
Robert Sparks 2016-10-07 17:29:05 +00:00
parent 5b32cc2da7
commit 933134f4cc
2 changed files with 12 additions and 6 deletions

View file

@ -804,6 +804,11 @@ class DocTestCase(TestCase):
self.assertEqual(r.status_code, 200) self.assertEqual(r.status_code, 200)
self.assertTrue("Request publication" in unicontent(r)) 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): class AddCommentTestCase(TestCase):
def test_add_comment(self): def test_add_comment(self):

View file

@ -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") 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): and can_edit_stream_info and not snapshot):
label = "Request Publication" if doc.get_state_slug('draft-stream-%s' % doc.stream_id) not in ('rfc-edit', 'pub', 'dead'):
if not doc.intended_std_level: label = "Request Publication"
label += " (note that intended status is not set)" if not doc.intended_std_level:
if iesg_state and iesg_state.slug != 'dead': label += " (note that intended status is not set)"
label += " (Warning: the IESG state indicates ongoing IESG processing)" if iesg_state and iesg_state.slug != 'dead':
actions.append((label, urlreverse('doc_request_publication', kwargs=dict(name=doc.name)))) 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 doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ietf",) and not snapshot:
if not iesg_state and can_edit: if not iesg_state and can_edit: