Commit a9dbd73e authored by Pierre Dittgen's avatar Pierre Dittgen

Validation error redirect to validation form

parent 30b8a478
......@@ -328,13 +328,17 @@ def validate(schema_instance: SchemaInstance, source: ValidataResource):
# 400
if req.status_code == 400:
json_response = req.json()
if json_response.get('message') == 'Missing headers':
flash_error("Impossible d'extraire les en-têtes du fichier tabulaire")
return redirect(compute_validation_form_url(schema_instance))
flash_error("Une erreur est survenue durant la validation: {}"
.format(json_response.get('message')))
return redirect(url_for("home"))
return redirect(compute_validation_form_url(schema_instance))
if not req.ok:
flash_error("Un erreur s'est produite côté serveur :-(")
return redirect(url_for("home"))
return redirect(compute_validation_form_url(schema_instance))
json_response = req.json()
validata_core_report = json_response['report']
......
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