Adjust when publication request button appears for documents in non-ietf streams. Fixes bug #1402. Commit ready for merge.

- Legacy-Id: 7748
This commit is contained in:
Robert Sparks 2014-05-14 17:31:00 +00:00
parent c64243ba31
commit e9984b957b
2 changed files with 19 additions and 1 deletions

View file

@ -351,6 +351,22 @@ class DocTestCase(TestCase):
self.assertEqual(r.status_code, 200)
self.assertTrue(State.objects.get(type="draft-iesg", slug="lc").name in r.content)
def test_document_nonietf_pubreq_button(self):
doc = make_test_data()
self.client.login(username='iab-chair', password='iab-chair+password')
r = self.client.get(urlreverse("doc_view", kwargs=dict(name=doc.name)))
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertFalse(q('.actions'))
Document.objects.filter(pk=doc.pk).update(stream='iab')
r = self.client.get(urlreverse("doc_view", kwargs=dict(name=doc.name)))
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertTrue('IESG state' in q('.actions').html())
class AddCommentTestCase(TestCase):
def test_add_comment(self):
draft = make_test_data()

View file

@ -311,10 +311,12 @@ def document_main(request, name, rev=None):
actions.append((label, urlreverse('conflict_review_start', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() != "expired" and doc.stream_id in ("iab", "ise", "irtf")
and can_edit_stream_info and not iesg_state):
and can_edit_stream_info):
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() != "expired" and doc.stream_id in ("ietf",):