projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86a4663
)
Support redirect when we get a messageid hit in archives search
author
Magnus Hagander
<magnus@hagander.net>
Sat, 12 Jan 2013 18:03:48 +0000
(19:03 +0100)
committer
Magnus Hagander
<magnus@hagander.net>
Sat, 12 Jan 2013 18:03:48 +0000
(19:03 +0100)
pgweb/search/views.py
patch
|
blob
|
blame
|
history
diff --git
a/pgweb/search/views.py
b/pgweb/search/views.py
index 49eb31599ad886279ae60c0762d8aec8f4e30d6d..30b9cf6690d276f96b9e7ac371acebb012a203fd 100644
(file)
--- a/
pgweb/search/views.py
+++ b/
pgweb/search/views.py
@@
-193,6
+193,13
@@
def search(request):
memc.set(urlstr, hits, 60*10, 1)
memc = None
+ if isinstance(hits, dict):
+ # This is not just a list of hits.
+ # Right now the only supported dict result is a messageid
+ # match, but make sure that's what it is.
+ if hits['messageidmatch'] == 1:
+ return HttpResponseRedirect("/message-id/%s" % query)
+
totalhits = len(hits)
querystr = "?m=1&q=%s&l=%s&d=%s&s=%s" % (
urllib.quote_plus(query.encode('utf-8')),