diff options
author | Alexandre Flament <alex@al-f.net> | 2016-11-02 14:52:22 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2016-11-02 14:52:22 +0100 |
commit | 58a6c045c81a84abfb8a29368e7d5453efc5f2fa (patch) | |
tree | c39ce3ba1bdd8d7f02543b11f5f20ea1ade2d0f5 /searx/search.py | |
parent | fbb080f3588ad43bf896a569257f3a95e1181d7b (diff) | |
download | searxng-58a6c045c81a84abfb8a29368e7d5453efc5f2fa.tar.gz searxng-58a6c045c81a84abfb8a29368e7d5453efc5f2fa.zip |
[mod] replace references request.request_data (GET or POST parameters) by request.form (based on merge of POST and GET parameters)
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/searx/search.py b/searx/search.py index a8de143b0..4c4a6a2f0 100644 --- a/searx/search.py +++ b/searx/search.py @@ -128,7 +128,7 @@ def make_callback(engine_name, callback, params, result_container): return process_callback -def get_search_query_from_webapp(preferences, request_data): +def get_search_query_from_webapp(preferences, form): query = None query_engines = [] query_categories = [] @@ -147,11 +147,11 @@ def get_search_query_from_webapp(preferences, request_data): query_safesearch = preferences.get_value('safesearch') # TODO better exceptions - if not request_data.get('q'): + if not form.get('q'): raise Exception('noquery') # set pagenumber - pageno_param = request_data.get('pageno', '1') + pageno_param = form.get('pageno', '1') if not pageno_param.isdigit() or int(pageno_param) < 1: pageno_param = 1 @@ -159,7 +159,7 @@ def get_search_query_from_webapp(preferences, request_data): # parse query, if tags are set, which change # the serch engine or search-language - raw_text_query = RawTextQuery(request_data['q'], disabled_engines) + raw_text_query = RawTextQuery(form['q'], disabled_engines) raw_text_query.parse_query() # set query @@ -170,7 +170,7 @@ def get_search_query_from_webapp(preferences, request_data): if len(raw_text_query.languages): query_lang = raw_text_query.languages[-1] - query_time_range = request_data.get('time_range') + query_time_range = form.get('time_range') query_engines = raw_text_query.engines @@ -185,7 +185,7 @@ def get_search_query_from_webapp(preferences, request_data): else: # set categories/engines load_default_categories = True - for pd_name, pd in request_data.items(): + for pd_name, pd in form.items(): if pd_name == 'categories': query_categories.extend(categ for categ in map(unicode.strip, pd.split(',')) if categ in categories) elif pd_name == 'engines': |