diff --git a/plinth/modules/zoph/privileged.py b/plinth/modules/zoph/privileged.py index 67e386a48..fe3decdcf 100644 --- a/plinth/modules/zoph/privileged.py +++ b/plinth/modules/zoph/privileged.py @@ -95,13 +95,9 @@ def set_configuration(enable_osm: bool | None = None, @privileged def is_configured() -> bool | None: """Return whether zoph app is configured.""" - try: - process = subprocess.run( - ['zoph', '--get-config', 'interface.user.remote'], - stdout=subprocess.PIPE, check=True) - return process.stdout.decode().strip() == 'true' - except FileNotFoundError: - return None + process = subprocess.run(['zoph', '--get-config', 'interface.user.remote'], + stdout=subprocess.PIPE, check=True) + return process.stdout.decode().strip() == 'true' @privileged diff --git a/plinth/modules/zoph/views.py b/plinth/modules/zoph/views.py index f646f5de6..9e9cabb1b 100644 --- a/plinth/modules/zoph/views.py +++ b/plinth/modules/zoph/views.py @@ -48,12 +48,12 @@ class ZophAppView(views.AppView): def dispatch(self, request, *args, **kwargs): """Redirect to setup page if setup is not done yet.""" - is_configured = privileged.is_configured() - if is_configured is False: - return redirect('zoph:setup') + status = self.get_common_status() + if status['is_enabled']: + # When disabled, such as when uninstalling + if privileged.is_configured() is False: + return redirect('zoph:setup') - # During operations such as uninstall, zoph command may not be - # available, let the base class show operations view instead. return super().dispatch(request, *args, **kwargs) def get_initial(self):