diff options
author | Alexandre Flament <alex@al-f.net> | 2019-08-02 20:38:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 20:38:53 +0200 |
commit | d24e7948ebd8aaa25a1907c225e1d2d3de37c17c (patch) | |
tree | ce1e1b941d61e7b7c5e8837d3e3350827d6f8b8c | |
parent | 72029d27ded8d93ab891c616d6bffbe8d3a67dd2 (diff) | |
parent | ba80a0ba380d0177634a471f38142f840e06b9b5 (diff) | |
download | searxng-d24e7948ebd8aaa25a1907c225e1d2d3de37c17c.tar.gz searxng-d24e7948ebd8aaa25a1907c225e1d2d3de37c17c.zip |
Merge pull request #1665 from dalf/fix-paging
[fix] fix paging for the oscar theme after PR #1640
Close #1664
-rw-r--r-- | searx/search.py | 11 | ||||
-rw-r--r-- | searx/templates/oscar/results.html | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/searx/search.py b/searx/search.py index a2c1c85f2..9c7142c74 100644 --- a/searx/search.py +++ b/searx/search.py @@ -279,10 +279,13 @@ def get_search_query_from_webapp(preferences, form): query_timeout = raw_text_query.timeout_limit if query_timeout is None and 'timeout_limit' in form: raw_time_limit = form.get('timeout_limit') - try: - query_timeout = float(raw_time_limit) - except ValueError: - raise SearxParameterException('timeout_limit', raw_time_limit) + if raw_time_limit in ['None', '']: + raw_time_limit = None + else: + try: + query_timeout = float(raw_time_limit) + except ValueError: + raise SearxParameterException('timeout_limit', raw_time_limit) # query_categories query_categories = [] diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index ce557daf9..9a95265b9 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -5,7 +5,7 @@ <input type="hidden" name="pageno" value="{{ pageno }}" />
<input type="hidden" name="time_range" value="{{ time_range }}" />
<input type="hidden" name="language" value="{{ current_language }}" />
- <input type="hidden" name="timeout_limit" value="{{ timeout_limit }}" />
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif %}
{%- endmacro %}
{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%}
|