add format_checker to validate data
This commit is contained in:
parent
812ac6ab91
commit
148d28d808
|
@ -256,7 +256,11 @@ class ImportForm(forms.Form):
|
||||||
|
|
||||||
def validate_jsonld(self, line, row):
|
def validate_jsonld(self, line, row):
|
||||||
try:
|
try:
|
||||||
jsonschema.validate(instance=row, schema=self.json_schema)
|
jsonschema.validate(
|
||||||
|
instance=row,
|
||||||
|
schema=self.json_schema,
|
||||||
|
format_checker=jsonschema.Draft202012Validator.FORMAT_CHECKER
|
||||||
|
)
|
||||||
except jsonschema.exceptions.ValidationError as err:
|
except jsonschema.exceptions.ValidationError as err:
|
||||||
msg = "line {}: {}".format(line+1, err)
|
msg = "line {}: {}".format(line+1, err)
|
||||||
return self.exception(msg)
|
return self.exception(msg)
|
||||||
|
|
Loading…
Reference in New Issue