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
Validata
Validata UI
Commits
e282b0d3
Commit
e282b0d3
authored
Oct 17, 2018
by
Pierre Dittgen
Browse files
Small fixes
parent
57c891a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
validata_ui/error_messages.py
View file @
e282b0d3
...
...
@@ -138,6 +138,10 @@ def type_or_format_error(err, headers, schema):
# Default date err msg
return
u_err
(
err
,
'Format de date incorrect'
,
'La date doit être écrite sous la forme aaaa-mm-jj.'
)
# Year
elif
err_type
==
'year'
:
return
u_err
(
err
,
'Format d
\'
année incorrect'
,
'L
\'
année doit être composée de 4 chiffres'
)
# Number
elif
err_type
==
'number'
:
if
','
in
err_value
:
...
...
@@ -147,7 +151,11 @@ def type_or_format_error(err, headers, schema):
# Number
elif
err_type
==
'integer'
:
return
u_err
(
err
,
'Format entier incorrect'
,
'La valeur ne doit être un nombre entier.'
)
return
u_err
(
err
,
'Format entier incorrect'
,
'La valeur doit être un nombre entier.'
)
# String
elif
err_type
==
'string'
:
return
u_err
(
err
,
'Format de chaîne incorrect'
,
'La valeur doit être une chaîne de caractères.'
)
# Boolean
elif
err_type
==
'boolean'
:
...
...
validata_ui/views.py
View file @
e282b0d3
...
...
@@ -26,9 +26,7 @@ def extract_source_data(source: ValidataSource, preview_rows_nb=5):
def
stringify
(
val
):
""" Transform value into string """
if
val
is
None
:
return
''
return
str
(
val
)
return
''
if
val
is
None
else
str
(
val
)
header
=
None
rows
=
[]
...
...
@@ -215,7 +213,8 @@ def validate(schema_code, source: ValidataSource):
source
=
source
,
source_type
=
source
.
type
,
source_data
=
source_data
,
report_str
=
json
.
dumps
(
validata_report
,
sort_keys
=
True
,
indent
=
2
),
breadcrumbs
=
[{
'url'
:
url_for
(
'home'
),
'title'
:
'Accueil'
},
{
'url'
:
url_for
(
'scdl_validator'
,
val_code
=
schema_code
),
'title'
:
val_info
[
'title'
]}])
{
'url'
:
url_for
(
'scdl_validator'
,
val_code
=
schema_code
),
'title'
:
val_info
[
'title'
]}])
def
bytes_data
(
f
):
...
...
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