summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest/ajax.py
diff options
context:
space:
mode:
authorMagnus Hagander2014-05-24 16:24:03 +0000
committerMagnus Hagander2014-05-24 16:24:03 +0000
commit1d83d6ba57056061ae94271a880061adb101889e (patch)
treec0cad37996331a769b7bd7c1925b9079b31c0edb /pgcommitfest/commitfest/ajax.py
parent3f9028639968956d9cf06ec030930b6d87508f55 (diff)
Pass search queries down to the archives API endpoint
This makes LIMIT work properly..
Diffstat (limited to 'pgcommitfest/commitfest/ajax.py')
-rw-r--r--pgcommitfest/commitfest/ajax.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py
index 75fbc76..643af70 100644
--- a/pgcommitfest/commitfest/ajax.py
+++ b/pgcommitfest/commitfest/ajax.py
@@ -49,11 +49,12 @@ def getThreads(request):
search = request.GET.has_key('s') and request.GET['s'] or None
# Make a JSON api call to the archives server
- r = _archivesAPI('/list/pgsql-hackers/latest.json', {'n': 100, 'a': 1})
+ params = {'n': 100, 'a': 1}
if search:
- return sorted([x for x in r if x['subj'].lower().find(search)>=0 or x['from'].lower().find(search)>=0], key=lambda x: x['date'], reverse=True)
- else:
- return sorted(r, key=lambda x: x['date'], reverse=True)
+ params['s'] = search
+
+ r = _archivesAPI('/list/pgsql-hackers/latest.json', params)
+ return sorted(r, key=lambda x: x['date'], reverse=True)
def parse_and_add_attachments(threadinfo, mailthread):