From 57f548ecbde5ec9c5ec38f0e7c494669406df1a4 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Tue, 24 Apr 2018 18:27:19 +0000 Subject: [PATCH] Simplified docs_in_iesg_process. Added a test for it. - Legacy-Id: 15074 --- ietf/doc/tests.py | 9 +++++++++ ietf/doc/urls.py | 2 +- ietf/doc/views_search.py | 11 +++-------- ietf/templates/doc/drafts_in_iesg_process.html | 3 --- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 06fc3a0c3..5d56ac43b 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -212,6 +212,15 @@ class SearchTests(TestCase): r = self.client.get(urlreverse('ietf.doc.views_search.drafts_in_last_call')) self.assertEqual(r.status_code, 200) self.assertTrue(draft.title in unicontent(r)) + + def test_in_iesg_process(self): + doc_in_process = DocumentFactory(type_id='draft') + doc_in_process.set_state(State.objects.get(type='draft-iesg', slug='lc')) + doc_not_in_process = DocumentFactory(type_id='draft') + r = self.client.get(urlreverse('ietf.doc.views_search.drafts_in_iesg_process')) + self.assertEqual(r.status_code, 200) + self.assertTrue(doc_in_process.title in unicontent(r)) + self.assertFalse(doc_not_in_process.title in unicontent(r)) def test_indexes(self): draft = make_test_data() diff --git a/ietf/doc/urls.py b/ietf/doc/urls.py index 0888e4570..24df5944a 100644 --- a/ietf/doc/urls.py +++ b/ietf/doc/urls.py @@ -51,7 +51,7 @@ urlpatterns = [ url(r'^ad2/(?P[\w.-]+)/$(?u)', RedirectView.as_view(url='/doc/ad/%(name)s/', permanent=True)), url(r'^rfc-status-changes/?$', views_status_change.rfc_status_changes), url(r'^start-rfc-status-change/(?:%(name)s/)?$' % settings.URL_REGEXPS, views_status_change.start_rfc_status_change), - url(r'^iesg/(?P[A-Za-z0-9.-]+/)?$', views_search.drafts_in_iesg_process), + url(r'^iesg/?$', views_search.drafts_in_iesg_process), url(r'^email-aliases/?$', views_doc.email_aliases), url(r'^downref/?$', views_downref.downref_registry), url(r'^downref/add/?$', views_downref.downref_registry_add), diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index ccfbd136b..ad8be174b 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -426,13 +426,9 @@ def drafts_in_last_call(request): 'form':form, 'docs':results, 'meta':meta, 'pages':pages }) -def drafts_in_iesg_process(request, last_call_only=None): - if last_call_only: - states = State.objects.filter(type="draft-iesg", slug__in=("lc", "writeupw", "goaheadw")) - title = "Documents in Last Call" - else: - states = State.objects.filter(type="draft-iesg").exclude(slug__in=('pub', 'dead', 'watching', 'rfcqueue')) - title = "Documents in IESG process" +def drafts_in_iesg_process(request): + states = State.objects.filter(type="draft-iesg").exclude(slug__in=('pub', 'dead', 'watching', 'rfcqueue')) + title = "Documents in IESG process" grouped_docs = [] @@ -451,7 +447,6 @@ def drafts_in_iesg_process(request, last_call_only=None): return render(request, 'doc/drafts_in_iesg_process.html', { "grouped_docs": grouped_docs, "title": title, - "last_call_only": last_call_only, }) def index_all_drafts(request): diff --git a/ietf/templates/doc/drafts_in_iesg_process.html b/ietf/templates/doc/drafts_in_iesg_process.html index d349634fe..d950b515c 100644 --- a/ietf/templates/doc/drafts_in_iesg_process.html +++ b/ietf/templates/doc/drafts_in_iesg_process.html @@ -5,9 +5,6 @@ {% load textfilters %} {% block pagehead %} - {% if last_call_only %} - - {% endif %} {% endblock %}