ttrss: Don't show app in enabled list of apps if install fails

Closes: #1615.

Tests:

- Throw an unconditional exception in enable_api_access() method. Reproduce the
problem described by installing ttrss app. Installation fails but ttrss shows up
in enabled list.

- Apply the patch. Try to install ttrss. When it fails, the app is not in the
enabled list.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-04-25 12:43:18 -07:00 committed by James Valleroy
parent 537cc749d1
commit 3922d7c71f
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -94,7 +94,6 @@ class TTRSSApp(app_module.App):
def enable(self):
"""Enable components and API access."""
super().enable()
privileged.enable_api_access()
# Try to set the domain to one of the available TLS domains
@ -104,6 +103,8 @@ class TTRSSApp(app_module.App):
domain = next(names.get_available_tls_domains(), None)
privileged.set_domain(domain)
super().enable()
def setup(self, old_version):
"""Install and configure the app."""
privileged.pre_setup()