/ipr/search/: avoid exception for unexpected search types; comment out debug logging

- Legacy-Id: 2217
This commit is contained in:
Pasi Eronen 2010-03-29 07:17:43 +00:00
parent 1c44d65d76
commit ed7c14cc79
2 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,7 @@ import django.utils.html
from django.shortcuts import render_to_response as render
from django.template import RequestContext
from django.conf import settings
from django.http import Http404
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
from ietf.ipr.related import related_docs
@ -60,7 +61,7 @@ def search(request, type="", q="", id=""):
if re.match(".*id", key):
id = value
if type and q or id:
log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
#log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
# Search by RFC number or draft-identifier
# Document list with IPRs
@ -183,6 +184,6 @@ def search(request, type="", q="", id=""):
context_instance=RequestContext(request) )
else:
raise ValueError("Unexpected search type in IPR query: %s" % type)
raise Http404("Unexpected search type in IPR query: %s" % type)
return django.http.HttpResponseRedirect(request.path)
return render("ipr/search.html", {"wgs": wgs}, context_instance=RequestContext(request))

View file

@ -64,6 +64,7 @@
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortel
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortelxz # Empty result
404 /ipr/search/?id_document_tag=12345 # no search type: 404
200 /ipr/about/
200 /ipr/by-draft/