From ddc33f109e6ad1daa1caf49eea6c7c394d96cec4 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, kiwitcms/trackers-integration#34 --- tcms/testcases/admin.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tcms/testcases/admin.py b/tcms/testcases/admin.py index 87476dac23..70d503529e 100644 --- a/tcms/testcases/admin.py +++ b/tcms/testcases/admin.py @@ -190,14 +190,27 @@ 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