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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-03-12 21:07:57 -07:00 committed by James Valleroy
parent 1612318b60
commit 8d0455aa45
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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)