Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
validata-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Validata
validata-ui
Commits
ce6ccb1b
Commit
ce6ccb1b
authored
Dec 03, 2018
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error display on source error
parent
ae4b0349
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
validata_ui/views.py
validata_ui/views.py
+9
-1
No files found.
validata_ui/views.py
View file @
ce6ccb1b
...
...
@@ -8,7 +8,6 @@ import json
import
logging
import
subprocess
import
tempfile
import
time
from
datetime
import
datetime
from
io
import
BytesIO
from
operator
import
itemgetter
...
...
@@ -220,6 +219,15 @@ def validate(schema_code, source: ValidataSource):
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
]
msg
=
"l'encodage du fichier est invalide. Veuillez le corriger"
if
'charmap'
in
err
[
'message'
]
else
err
[
'message'
]
flash_error
(
'Erreur de source : {}'
.
format
(
msg
))
return
redirect
(
url_for
(
'scdl_validator'
,
val_code
=
schema_code
))
source_data
=
extract_source_data
(
source
)
# handle report date
...
...
Write
Preview
Markdown
is supported
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