From 148d28d80860fd2d5d48d33fa5193f91a08d8d43 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Feb 2024 16:00:44 +0100 Subject: [PATCH] add format_checker to validate data --- idhub/admin/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index f9ceecc..6c5d49c 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -256,7 +256,11 @@ class ImportForm(forms.Form): def validate_jsonld(self, line, row): 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: msg = "line {}: {}".format(line+1, err) return self.exception(msg)