Pass response as str to bsoup for "my ip" card
Due to how the response is now reformed into a new bsoup object when bolding search query terms, creating an ip card for "my ip" searches threw an error due to how the new bsoup object was initialized for the "my ip" card. This passes the response in as a string instead. Fixes #504main
parent
cad1e2ab4d
commit
26b560da1d
|
@ -253,9 +253,10 @@ def search():
|
|||
# Return 503 if temporarily blocked by captcha
|
||||
resp_code = 503 if has_captcha(str(response)) else 200
|
||||
response = bold_search_terms(response, query)
|
||||
|
||||
# Feature to display IP address
|
||||
if search_util.check_kw_ip():
|
||||
html_soup = bsoup(response, "html.parser")
|
||||
html_soup = bsoup(str(response), 'html.parser')
|
||||
response = add_ip_card(html_soup, request.remote_addr)
|
||||
|
||||
return render_template(
|
||||
|
|
Loading…
Reference in New Issue