Open KatiRG opened 1 year ago
That sounds like an error in ckanext-ontario_theme
rather than ckanext-validation
.
@ThrawnCA I tested with core CKAN and got the same error with slice.
To avoid the error I have to set something like this in resource_schema.html
:
{# % set is_url = value and value[4:]|lower == 'http' % #}
{# % set is_json = not is_url and value % #}
{% set is_url = 'http' in value %}
{% set is_json = not is_url %}
CKAN errors out at line 4 of
resource_schema.html
if I have uploaded a JSON file containing a schema. The error is:The JSON file contains the following schema object:
and this object gets assigned to the
value
in line 4.The line 4 checks if the schema is URL-based, but in this case,
value
is the above object, thereforevalue[4:]
is invalid. Also, assumingvalue
=http://someaddress
, shouldn't the slice bevalue[:4]
?