From f2d6458d08bd9927f2309f30b9b8833a228e3380 Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Thu, 13 Jan 2022 21:24:08 -0500 Subject: [PATCH] Set `WHOOGLE_AUTOCOMPLETE` to `autocomplete_enabled` to be used in `index.html` and `routes.html` --- app/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 44206d1..56434fc 100644 --- a/app/routes.py +++ b/app/routes.py @@ -37,6 +37,8 @@ newest_version = int(''.join(filter(str.isdigit, newest_version))) newest_version = '' if current_version >= newest_version \ else newest_version +ac_var='WHOOGLE_AUTOCOMPLETE' +autocomplete_enabled=os.getenv(ac_var,'1') def auth_required(f): @wraps(f) @@ -201,6 +203,7 @@ def index(): languages=app.config['LANGUAGES'], countries=app.config['COUNTRIES'], themes=app.config['THEMES'], + autocomplete_enabled=autocomplete_enabled, translation=app.config['TRANSLATIONS'][ g.user_config.get_localization_lang() ], @@ -246,7 +249,6 @@ def search_html(): @app.route(f'/{Endpoint.autocomplete}', methods=['GET', 'POST']) def autocomplete(): - ac_var = 'WHOOGLE_AUTOCOMPLETE' if os.getenv(ac_var) and not read_config_bool(ac_var): return jsonify({}) @@ -344,6 +346,7 @@ def search(): query=urlparse.unquote(query), search_type=search_util.search_type, config=g.user_config, + autocomplete_enabled=autocomplete_enabled, lingva_url=app.config['TRANSLATE_URL'], translation=translation, translate_to=translate_to,