mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
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 <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
52f42a4f74
commit
1e30b4c8fc
@ -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([
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user