summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2017-10-25 23:56:37 +0200
committerAdam Tauber <asciimoo@gmail.com>2017-10-26 00:06:03 +0200
commit5f758b2d39becf251a9097264d7414ad9c471d62 (patch)
tree82de6d5afbb0c73669f007225893a05e60d00601 /searx/webapp.py
parentb34124fd8a6b020136ca9656acdb01afceabe96f (diff)
downloadsearxng-5f758b2d39becf251a9097264d7414ad9c471d62.tar.gz
searxng-5f758b2d39becf251a9097264d7414ad9c471d62.zip
[mod] compress saved preferences in url
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index f90299b2a..dd93395ee 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -403,11 +403,15 @@ def pre_request():
for k, v in request.args.items():
if k not in request.form:
request.form[k] = v
- try:
- preferences.parse_dict(request.form)
- except Exception as e:
- logger.exception('invalid settings')
- request.errors.append(gettext('Invalid settings'))
+
+ if request.form.get('preferences'):
+ preferences.parse_encoded_data(request.form['preferences'])
+ else:
+ try:
+ preferences.parse_dict(request.form)
+ except Exception as e:
+ logger.exception('invalid settings')
+ request.errors.append(gettext('Invalid settings'))
# request.user_plugins
request.user_plugins = []