Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alexandre Bulté
validata-ui
Commits
98bf02ef
Commit
98bf02ef
authored
Dec 14, 2018
by
Pierre Dittgen
Browse files
Fix Internal server on validation
parent
47535f5f
Changes
1
Show whitespace changes
Inline
Side-by-side
validata_ui/views.py
View file @
98bf02ef
...
...
@@ -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
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment