Commit 98bf02ef authored by Pierre Dittgen's avatar Pierre Dittgen

Fix Internal server on validation

parent 47535f5f
......@@ -212,13 +212,18 @@ def validate(schema_code, source: ValidataSource):
validata_core_report = ValidatorHelper.validate(
schema_code=schema_code,
force_strings=True,
**source.get_tabulator_params(),
**source.get_tabulator_params()
)
# Validator.validate() doesn't throw FormatError if source.format is None
# Just do it manually
if source.format is None:
raise tabulator.exceptions.FormatError()
except tabulator.exceptions.FormatError:
flash_error('Erreur : format de fichier non supporté')
return redirect(url_for('scdl_validator', val_code=schema_code))
# source_errors = [err for err in validata_core_report['tables'][0]['errors'] if err['code'] == 'source-error']
source_errors = [err for err in validata_core_report['tables'][0]['errors'] if err['code'] == 'source-error']
if source_errors:
err = source_errors[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment