Fix warning

This commit is contained in:
shamoon
2025-02-13 21:30:25 -08:00
parent 7c3f011e84
commit 7f02f782f4
4 changed files with 14 additions and 10 deletions

View File

@@ -225,7 +225,6 @@ class TestSystemStatus(APITestCase):
response.data["tasks"]["classifier_status"],
"WARNING",
)
self.assertIsNone(response.data["tasks"]["classifier_error"])
def test_system_status_classifier_error(self):
"""
@@ -287,7 +286,6 @@ class TestSystemStatus(APITestCase):
response.data["tasks"]["sanity_check_status"],
"WARNING",
)
self.assertIsNone(response.data["tasks"]["sanity_check_error"])
def test_system_status_sanity_check_error(self):
"""

View File

@@ -2670,6 +2670,7 @@ class SystemStatusView(PassUserMixin):
classifier_error = None
if last_trained_task is None:
classifier_status = "WARNING"
classifier_error = "No classifier training tasks found"
elif last_trained_task and last_trained_task.status == states.FAILURE:
classifier_status = "ERROR"
classifier_error = last_trained_task.result
@@ -2688,6 +2689,7 @@ class SystemStatusView(PassUserMixin):
sanity_check_error = None
if last_sanity_check is None:
sanity_check_status = "WARNING"
sanity_check_error = "No sanity check tasks found"
elif last_sanity_check and last_sanity_check.status == states.FAILURE:
sanity_check_status = "ERROR"
sanity_check_error = last_sanity_check.result