From ac7e727faba04aeb3e57b396f058d2797f89f482 Mon Sep 17 00:00:00 2001 From: Thomas Hanke Date: Tue, 17 Sep 2024 14:48:50 +0200 Subject: [PATCH] another small fix --- ckanext/csvwmapandtransform/action.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ckanext/csvwmapandtransform/action.py b/ckanext/csvwmapandtransform/action.py index 3af4d64..e5fb315 100644 --- a/ckanext/csvwmapandtransform/action.py +++ b/ckanext/csvwmapandtransform/action.py @@ -37,7 +37,7 @@ def __init__(self, **kwargs): def csvwmapandtransform_find_mappings(context: Context, data_dict): mapping_group_id = next( ( - entry["id"] if entry["title"] == MAPPING_GROUP else None + entry["id"] if entry["name"] == MAPPING_GROUP else None for entry in toolkit.get_action("group_list")({}, {"all_fields": True}) ), None, @@ -48,12 +48,10 @@ def csvwmapandtransform_find_mappings(context: Context, data_dict): {"ignore_auth": True}, {"id": mapping_group_id, "include_datasets": True} ) else: - try: - mapping_group = create_group(MAPPING_GROUP) - except: - pass + log.warn("group with name mappings not found!") + mapping_group = create_group(MAPPING_GROUP) + log.info("created group mappings") packages = mapping_group.get("packages", None) - log.info(f"mappings=={packages}") if packages: packages = [