diff --git a/ckanext/validation/helpers.py b/ckanext/validation/helpers.py index b6c856df..972aa090 100644 --- a/ckanext/validation/helpers.py +++ b/ckanext/validation/helpers.py @@ -72,8 +72,14 @@ def validation_extract_report_from_errors(errors): return report, errors + def validation_dict(validation_json): - return json.loads(validation_json) + if isinstance(validation_json, str): + return json.loads(validation_json) + else: + validation_temp = json.dumps(validation_json) + return json.loads(validation_temp) + def dump_json_value(value, indent=None): """