From 51772ff73b215688966c8614cca468edb37bc1f6 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Sun, 7 Dec 2025 23:30:45 -0500 Subject: [PATCH 1/2] fix resource form publish error handling --- ckan/views/resource.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ckan/views/resource.py b/ckan/views/resource.py index cb03b5c2f4f..1ae743d4f19 100644 --- a/ckan/views/resource.py +++ b/ckan/views/resource.py @@ -234,10 +234,9 @@ def post(self, package_type: str, id: str) -> Union[str, Response]: _(u'The dataset {id} could not be found.').format(id=id) ) except ValidationError as e: - errors = cast( - "list[ErrorDict]", e.error_dict.get('resources', [{}]))[-1] + errors = cast("list[ErrorDict]", e.error_dict) error_summary = e.error_summary - return self.get(package_type, id, data, errors, error_summary) + return self.get(package_type, id, {}, errors, error_summary) return h.redirect_to(u'{}.read'.format(package_type), id=id) data[u'package_id'] = id From 94bc571e9d8de89e631e199338c32b236a867954 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Sat, 3 Jan 2026 12:31:42 -0500 Subject: [PATCH 2/2] [#9202] type checking --- ckan/views/resource.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ckan/views/resource.py b/ckan/views/resource.py index 1ae743d4f19..51d34aea6df 100644 --- a/ckan/views/resource.py +++ b/ckan/views/resource.py @@ -234,9 +234,8 @@ def post(self, package_type: str, id: str) -> Union[str, Response]: _(u'The dataset {id} could not be found.').format(id=id) ) except ValidationError as e: - errors = cast("list[ErrorDict]", e.error_dict) error_summary = e.error_summary - return self.get(package_type, id, {}, errors, error_summary) + return self.get(package_type, id, {}, e.error_dict, error_summary) return h.redirect_to(u'{}.read'.format(package_type), id=id) data[u'package_id'] = id