Skip to content

Commit

Permalink
Check if extras exist before converting
Browse files Browse the repository at this point in the history
In some situations like when validating an already validated dataset we
might be missing the `extras` key.

See
ckan/ckanext-dcat#305
ckan/ckan#7571
  • Loading branch information
amercader committed Oct 30, 2024
1 parent 27035f4 commit b2cd770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/scheming/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def composite_convert_to(key, data, errors, context):
del data[(f,)]

if action_type == 'show':
if composite_convert_fields:
if composite_convert_fields and data_dict.get("extras"):
for ex in data_dict['extras']:
if ex['key'] in composite_convert_fields:
data_dict[ex['key']] = json.loads(ex['value'])
Expand Down

0 comments on commit b2cd770

Please sign in to comment.