From 8d0455aa45c2074650f42732d1c7903fa4f0d991 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 12 Mar 2024 21:07:57 -0700 Subject: [PATCH] matrixsynapse: Prevent setup page from being shown during uninstall Fixes: #2381. When app is being uninstalled, it is disabled. Use that to not show the setup page. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/matrixsynapse/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plinth/modules/matrixsynapse/views.py b/plinth/modules/matrixsynapse/views.py index 503e49d39..3f081e5ba 100644 --- a/plinth/modules/matrixsynapse/views.py +++ b/plinth/modules/matrixsynapse/views.py @@ -53,8 +53,11 @@ class MatrixSynapseAppView(AppView): def dispatch(self, request, *args, **kwargs): """Redirect to setup page if setup is not done yet.""" - if not matrixsynapse.is_setup(): - return redirect('matrixsynapse:setup') + status = self.get_common_status() + if status['is_enabled']: + # App is disabled when uninstalling + if not matrixsynapse.is_setup(): + return redirect('matrixsynapse:setup') return super().dispatch(request, *args, **kwargs)