From 9aa32037336c8d8a6583207e9cc2af52337205e0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 9 Jan 2025 22:48:29 -0800 Subject: [PATCH] ttrss: Fix issue with installing after an uninstalling Tests: - Without the patch, uninstall and reinstall will fail. With patch it passes. - Rerunning setup does not destroy the contents of the database. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ttrss/__init__.py | 2 +- plinth/modules/ttrss/privileged.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plinth/modules/ttrss/__init__.py b/plinth/modules/ttrss/__init__.py index 35850c8cd..ad5a9b13e 100644 --- a/plinth/modules/ttrss/__init__.py +++ b/plinth/modules/ttrss/__init__.py @@ -38,7 +38,7 @@ class TTRSSApp(app_module.App): app_id = 'ttrss' - _version = 6 + _version = 7 def __init__(self) -> None: """Create components for the app.""" diff --git a/plinth/modules/ttrss/privileged.py b/plinth/modules/ttrss/privileged.py index 42434fd3f..4c5d60c12 100644 --- a/plinth/modules/ttrss/privileged.py +++ b/plinth/modules/ttrss/privileged.py @@ -77,6 +77,12 @@ def setup(): aug.save() + config = _get_database_config() + # dbconfig may not always setup the database and user account correctly. + # Following, operation to create database/user is an idempotent operation. + postgres.create_database(config['database'], config['user'], + config['password']) + if action_utils.service_is_enabled('tt-rss'): action_utils.service_restart('tt-rss')