Drop Python 2 (4/n): SearchQuery.query is a str instead of bytes

This commit is contained in:
Dalf 2020-08-11 16:25:03 +02:00 committed by Alexandre Flament
parent 7888377743
commit c225db45c8
20 changed files with 48 additions and 48 deletions

View file

@ -22,7 +22,7 @@ default_on = True
# Self User Agent regex
p = re.compile(b'.*user[ -]agent.*', re.IGNORECASE)
p = re.compile('.*user[ -]agent.*', re.IGNORECASE)
# attach callback to the post search hook
@ -31,7 +31,7 @@ p = re.compile(b'.*user[ -]agent.*', re.IGNORECASE)
def post_search(request, search):
if search.search_query.pageno > 1:
return True
if search.search_query.query == b'ip':
if search.search_query.query == 'ip':
x_forwarded_for = request.headers.getlist("X-Forwarded-For")
if x_forwarded_for:
ip = x_forwarded_for[0]