mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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."""
|
Re-enable if previously enabled."""
|
||||||
if pathlib.Path('/etc/searx/settings.yml').exists():
|
if pathlib.Path('/etc/searx/settings.yml').exists():
|
||||||
print('Updating searx search engines list...', flush=True)
|
print('Updating searx search engines list...', flush=True)
|
||||||
subprocess.run(['/usr/share/plinth/actions/searx', 'setup'],
|
subprocess.run([
|
||||||
check=True)
|
'/usr/share/plinth/actions/actions', 'searx', 'setup', '--no-args'
|
||||||
|
], check=True)
|
||||||
if reenable:
|
if reenable:
|
||||||
print('Re-enabling searx after upgrade...', flush=True)
|
print('Re-enabling searx after upgrade...', flush=True)
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from plinth import app as app_module
|
|
||||||
from plinth import views
|
from plinth import views
|
||||||
from plinth.modules import searx
|
from plinth.modules import searx
|
||||||
|
|
||||||
@ -22,8 +21,7 @@ class SearxAppView(views.AppView):
|
|||||||
"""Return the status of the service to fill in the form."""
|
"""Return the status of the service to fill in the form."""
|
||||||
initial = super().get_initial()
|
initial = super().get_initial()
|
||||||
initial['safe_search'] = privileged.get_safe_search()
|
initial['safe_search'] = privileged.get_safe_search()
|
||||||
initial['public_access'] = searx.is_public_access_enabled() and \
|
initial['public_access'] = searx.is_public_access_enabled()
|
||||||
app_module.App.get('searx').is_enabled()
|
|
||||||
return initial
|
return initial
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user