Skip to content

Commit 44a8eb2

Browse files
committed
Removed the old ad documents page, and it's view function, and put in a redirect from the temporary /ad2/ url to the /ad/ url.
- Legacy-Id: 6204
1 parent 23cdddf commit 44a8eb2

3 files changed

Lines changed: 9 additions & 36 deletions

File tree

ietf/doc/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_search(self):
104104
def test_drafts_pages(self):
105105
draft = make_test_data()
106106

107-
r = self.client.get(urlreverse("drafts_for_ad", kwargs=dict(name=draft.ad.full_name_as_key())))
107+
r = self.client.get(urlreverse("docs_for_ad", kwargs=dict(name=draft.ad.full_name_as_key())))
108108
self.assertEqual(r.status_code, 200)
109109
self.assertTrue(draft.title in r.content)
110110

ietf/doc/urls.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232

3333
from django.conf.urls.defaults import patterns, url, include
34+
from django.shortcuts import redirect
3435
from ietf.doc.models import State
3536
from ietf.doc import views_search, views_draft, views_ballot
3637
from ietf.doc import views_status_change
@@ -40,12 +41,14 @@
4041
(r'^/?$', views_search.search),
4142
url(r'^search/$', views_search.search, name="doc_search"),
4243
url(r'^in-last-call/$', views_search.drafts_in_last_call, name="drafts_in_last_call"),
43-
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.drafts_for_ad, name="drafts_for_ad"),
44-
# url(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
45-
url(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
44+
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
45+
)
46+
47+
urlpatterns += patterns('django.views.generic.simple',
48+
(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', 'redirect_to', {'url': '/doc/ad/%(name)s/', 'permanent': True}),
49+
)
4650

47-
# (r'^all/$', views_search.all), # XXX CHECK MERGE
48-
# (r'^active/$', views_search.active), # XXX CHECK MERGE
51+
urlpatterns += patterns('',
4952
url(r'^rfc-status-changes/$', views_status_change.rfc_status_changes, name='rfc_status_changes'),
5053
url(r'^start-rfc-status-change/(?P<name>[A-Za-z0-9._+-]*)$', views_status_change.start_rfc_status_change, name='start_rfc_status_change'),
5154
url(r'^iesg/(?P<last_call_only>[A-Za-z0-9.-]+/)?$', views_search.drafts_in_iesg_process, name="drafts_in_iesg_process"),

ietf/doc/views_search.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -491,36 +491,6 @@ def ad_dashboard_sort_key(doc):
491491

492492
return "3%s" % seed
493493

494-
def drafts_for_ad(request, name):
495-
ad = None
496-
responsible = Document.objects.values_list('ad', flat=True).distinct()
497-
for p in Person.objects.filter(Q(role__name__in=("pre-ad", "ad"),
498-
role__group__type="area",
499-
role__group__state="active")
500-
| Q(pk__in=responsible)).distinct():
501-
if name == p.full_name_as_key():
502-
ad = p
503-
break
504-
if not ad:
505-
raise Http404
506-
form = SearchForm({'by':'ad','ad': ad.id,
507-
'rfcs':'on', 'activedrafts':'on', 'olddrafts':'on',
508-
'sort': 'status'})
509-
results, meta = retrieve_search_results(form)
510-
del meta["headers"][-1]
511-
#
512-
for d in results:
513-
if d.get_state_slug() == "active":
514-
iesg_state = d.get_state("draft-iesg")
515-
if iesg_state:
516-
if iesg_state.slug == "dead":
517-
d.search_heading = "IESG Dead Internet-Drafts"
518-
else:
519-
d.search_heading = "%s Internet-Drafts" % iesg_state.name
520-
return render_to_response('doc/drafts_for_ad.html',
521-
{ 'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name() },
522-
context_instance=RequestContext(request))
523-
524494
def docs_for_ad(request, name):
525495
ad = None
526496
responsible = Document.objects.values_list('ad', flat=True).distinct()

0 commit comments

Comments
 (0)