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
This commit is contained in:
parent
23cdddf696
commit
44a8eb207b
|
@ -104,7 +104,7 @@ class SearchTestCase(django.test.TestCase):
|
|||
def test_drafts_pages(self):
|
||||
draft = make_test_data()
|
||||
|
||||
r = self.client.get(urlreverse("drafts_for_ad", kwargs=dict(name=draft.ad.full_name_as_key())))
|
||||
r = self.client.get(urlreverse("docs_for_ad", kwargs=dict(name=draft.ad.full_name_as_key())))
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertTrue(draft.title in r.content)
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from django.conf.urls.defaults import patterns, url, include
|
||||
from django.shortcuts import redirect
|
||||
from ietf.doc.models import State
|
||||
from ietf.doc import views_search, views_draft, views_ballot
|
||||
from ietf.doc import views_status_change
|
||||
|
@ -40,12 +41,14 @@ urlpatterns = patterns('',
|
|||
(r'^/?$', views_search.search),
|
||||
url(r'^search/$', views_search.search, name="doc_search"),
|
||||
url(r'^in-last-call/$', views_search.drafts_in_last_call, name="drafts_in_last_call"),
|
||||
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.drafts_for_ad, name="drafts_for_ad"),
|
||||
# url(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
|
||||
url(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
|
||||
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.docs_for_ad, name="docs_for_ad"),
|
||||
)
|
||||
|
||||
# (r'^all/$', views_search.all), # XXX CHECK MERGE
|
||||
# (r'^active/$', views_search.active), # XXX CHECK MERGE
|
||||
urlpatterns += patterns('django.views.generic.simple',
|
||||
(r'^ad2/(?P<name>[A-Za-z0-9.-]+)/$', 'redirect_to', {'url': '/doc/ad/%(name)s/', 'permanent': True}),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('',
|
||||
url(r'^rfc-status-changes/$', views_status_change.rfc_status_changes, name='rfc_status_changes'),
|
||||
url(r'^start-rfc-status-change/(?P<name>[A-Za-z0-9._+-]*)$', views_status_change.start_rfc_status_change, name='start_rfc_status_change'),
|
||||
url(r'^iesg/(?P<last_call_only>[A-Za-z0-9.-]+/)?$', views_search.drafts_in_iesg_process, name="drafts_in_iesg_process"),
|
||||
|
|
|
@ -491,36 +491,6 @@ def ad_dashboard_sort_key(doc):
|
|||
|
||||
return "3%s" % seed
|
||||
|
||||
def drafts_for_ad(request, name):
|
||||
ad = None
|
||||
responsible = Document.objects.values_list('ad', flat=True).distinct()
|
||||
for p in Person.objects.filter(Q(role__name__in=("pre-ad", "ad"),
|
||||
role__group__type="area",
|
||||
role__group__state="active")
|
||||
| Q(pk__in=responsible)).distinct():
|
||||
if name == p.full_name_as_key():
|
||||
ad = p
|
||||
break
|
||||
if not ad:
|
||||
raise Http404
|
||||
form = SearchForm({'by':'ad','ad': ad.id,
|
||||
'rfcs':'on', 'activedrafts':'on', 'olddrafts':'on',
|
||||
'sort': 'status'})
|
||||
results, meta = retrieve_search_results(form)
|
||||
del meta["headers"][-1]
|
||||
#
|
||||
for d in results:
|
||||
if d.get_state_slug() == "active":
|
||||
iesg_state = d.get_state("draft-iesg")
|
||||
if iesg_state:
|
||||
if iesg_state.slug == "dead":
|
||||
d.search_heading = "IESG Dead Internet-Drafts"
|
||||
else:
|
||||
d.search_heading = "%s Internet-Drafts" % iesg_state.name
|
||||
return render_to_response('doc/drafts_for_ad.html',
|
||||
{ 'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name() },
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
def docs_for_ad(request, name):
|
||||
ad = None
|
||||
responsible = Document.objects.values_list('ad', flat=True).distinct()
|
||||
|
|
Loading…
Reference in a new issue