From 1e30b4c8fc4379f4070487ed821fdcb1d3c215c0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 29 Sep 2022 17:11:10 -0700 Subject: [PATCH] searx: Show status of public access irrespective of enabled state - When the app is disabled, configuration can still be updated. Attempts to enable the setting while app is disabled seemingly fail. Tests: - Functional tests pass. - When public access is enabled and app is disabled, the page still shows public access as enabled. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- actions/upgrades | 5 +++-- plinth/modules/searx/views.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/actions/upgrades b/actions/upgrades index 66acce5dc..3365f991b 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -480,8 +480,9 @@ def _update_searx(reenable=False): Re-enable if previously enabled.""" if pathlib.Path('/etc/searx/settings.yml').exists(): print('Updating searx search engines list...', flush=True) - subprocess.run(['/usr/share/plinth/actions/searx', 'setup'], - check=True) + subprocess.run([ + '/usr/share/plinth/actions/actions', 'searx', 'setup', '--no-args' + ], check=True) if reenable: print('Re-enabling searx after upgrade...', flush=True) subprocess.run([ diff --git a/plinth/modules/searx/views.py b/plinth/modules/searx/views.py index c29f33901..f71e3a641 100644 --- a/plinth/modules/searx/views.py +++ b/plinth/modules/searx/views.py @@ -4,7 +4,6 @@ from django.contrib import messages from django.utils.translation import gettext as _ -from plinth import app as app_module from plinth import views from plinth.modules import searx @@ -22,8 +21,7 @@ class SearxAppView(views.AppView): """Return the status of the service to fill in the form.""" initial = super().get_initial() initial['safe_search'] = privileged.get_safe_search() - initial['public_access'] = searx.is_public_access_enabled() and \ - app_module.App.get('searx').is_enabled() + initial['public_access'] = searx.is_public_access_enabled() return initial def form_valid(self, form):