From: Magnus Hagander Date: Sat, 3 Oct 2015 16:22:15 +0000 (+0200) Subject: Strip <> and spaces from messageid's when searching X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=63f721da1145708bfb6fd075bf585e9902f57772;p=pgarchives.git Strip <> and spaces from messageid's when searching Amir Rohan --- diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py index e011827..7b94d1a 100644 --- a/django/archives/mailarchives/views.py +++ b/django/archives/mailarchives/views.py @@ -465,7 +465,7 @@ def search(request): # We don't do a more specific check if it's a messageid because doing # a key lookup is cheap... curs.execute("SELECT messageid FROM messages WHERE messageid=%(q)s", { - 'q': query, + 'q': query.lstrip(" \t\r\n<").rstrip(" \t\r\n>"), }) a = curs.fetchall() if len(a) == 1: