Skip to content

Commit

Permalink
another small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hanke committed Sep 17, 2024
1 parent 8bbf2ce commit ac7e727
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ckanext/csvwmapandtransform/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = [
Expand Down

0 comments on commit ac7e727

Please sign in to comment.