From ec57de3492c2eb117e1d105b714017e57225c907 Mon Sep 17 00:00:00 2001 From: seitenbau-govdata Date: Thu, 1 Jun 2023 10:30:02 +0200 Subject: [PATCH] Fix display of harvest job errors --- ckanext/harvest/templates/snippets/job_error_summary.html | 6 +++--- ckanext/harvest/tests/test_action.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ckanext/harvest/templates/snippets/job_error_summary.html b/ckanext/harvest/templates/snippets/job_error_summary.html index 2fb7b0314..5bad19f72 100644 --- a/ckanext/harvest/templates/snippets/job_error_summary.html +++ b/ckanext/harvest/templates/snippets/job_error_summary.html @@ -1,7 +1,7 @@ {# Displays a table with a summary of the most common errors for a job -error_summary - List of tuples with (message, count) +error_summary - List of dicts with message and error_count Example: @@ -22,8 +22,8 @@ {% for error in summary %} - {{ error[1] }} - {{ error[0] }} + {{ error["error_count"] }} + {{ error["message"] }} {% endfor %} diff --git a/ckanext/harvest/tests/test_action.py b/ckanext/harvest/tests/test_action.py index 1c937f492..e22bb5cd5 100644 --- a/ckanext/harvest/tests/test_action.py +++ b/ckanext/harvest/tests/test_action.py @@ -783,5 +783,7 @@ def test_harvest_source_show_status(self): assert last_job['stats']['errored'] == 2 assert len(last_job['object_error_summary']) == 1 assert last_job['object_error_summary'][0]['message'] == harvest_object_error.message + assert last_job['object_error_summary'][0]['error_count'] == 1 assert len(last_job['gather_error_summary']) == 1 assert last_job['gather_error_summary'][0]['message'] == harvest_gather_error.message + assert last_job['gather_error_summary'][0]['error_count'] == 1