Reference mailinglists by name when sending search query
authorMagnus Hagander <magnus@hagander.net>
Wed, 21 Mar 2018 12:15:59 +0000 (13:15 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 21 Mar 2018 12:16:43 +0000 (13:16 +0100)
This way we don't have to keep the exact id values in sync between
different systems, which makes it much less evil.

pgweb/search/views.py

index 8f11c3841a8b07e8d44a483145a152553387e0a3..29c39e1a11d9ca2cabbcc6b709632b926c7c221f 100644 (file)
@@ -171,9 +171,9 @@ def search(request):
                if listid:
                        if listid < 0:
                                # This is a list group, we expand that on the web server
-                               p['l'] = ','.join([str(x.id) for x in MailingList.objects.filter(group=-listid)])
+                               p['ln'] = ','.join([x.listname for x in MailingList.objects.filter(group=-listid)])
                        else:
-                               p['l'] = listid
+                               p['ln'] = MailingList.objects.get(pk=listid).listname
                if dateval:
                        p['d'] = dateval
                urlstr = urllib.urlencode(p)