From 1b10abfc92afed36627c7052b89d2de5e7f537ee Mon Sep 17 00:00:00 2001 From: Noémi Ványi Date: Wed, 1 Nov 2017 13:58:48 +0100 Subject: minor fixes of doi resolver Closes #1047 --- searx/webapp.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'searx/webapp.py') diff --git a/searx/webapp.py b/searx/webapp.py index 9542b7814..f81747325 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -66,6 +66,7 @@ from searx.search import SearchWithPlugins, get_search_query_from_webapp from searx.query import RawTextQuery from searx.autocomplete import searx_bang, backends as autocomplete_backends from searx.plugins import plugins +from searx.plugins.oa_doi_rewrite import get_doi_resolver from searx.preferences import Preferences, ValidationException from searx.answerers import answerers from searx.url_utils import urlencode, urlparse, urljoin @@ -164,14 +165,6 @@ def get_locale(): return locale -def get_doi_resolver(): - doi_resolvers = settings['doi_resolvers'] - doi_resolver = request.args.get('doi_resolver', request.preferences.get_value('doi_resolver'))[0] - if doi_resolver not in doi_resolvers: - doi_resolvers = settings['default_doi_resolver'] - return doi_resolver - - # code-highlighter @app.template_filter('code_highlighter') def code_highlighter(codelines, language=None): @@ -704,7 +697,7 @@ def preferences(): themes=themes, plugins=plugins, doi_resolvers=settings['doi_resolvers'], - current_doi_resolver=get_doi_resolver(), + current_doi_resolver=get_doi_resolver(request.args, request.preferences.get_value('doi_resolver')), allowed_plugins=allowed_plugins, theme=get_current_theme_name(), preferences_url_params=request.preferences.get_as_url_params(), -- cgit v1.2.3-54-g00ecf