From b93b663e093cf7b742af7a63c22b9d18b1ca5969 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Sun, 4 Jun 2023 14:10:07 +0300 Subject: [PATCH] Improve messaging for Issue Tracker Configuration health check Refs #3141, Closes #3191, Closes kiwitcms/trackers-integration#34 --- tcms/testcases/admin.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tcms/testcases/admin.py b/tcms/testcases/admin.py index 87476dac23..745f6fb869 100644 --- a/tcms/testcases/admin.py +++ b/tcms/testcases/admin.py @@ -190,14 +190,28 @@ def save_model(self, request, obj, form, change): raise RuntimeError(_("Failed creating Issue Tracker")) details = tracker.details(bug_url) + + if details["from_open_graph"]: + messages.add_message( + request, + messages.WARNING, + _( + "Details extracted via OpenGraph. " + "Issue Tracker may still be configured incorrectly!" + ), + ) + else: + messages.add_message( + request, + messages.SUCCESS, + _( + "Details extracted via API. Issue Tracker configuration looks good!" + ), + ) + messages.add_message( request, - messages.SUCCESS, - _("Issue Tracker configuration check passed"), - ) - messages.add_message( - request, - messages.SUCCESS, + messages.INFO, details, ) except Exception as err: # pylint: disable=broad-except