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
59ae4078
Commit
59ae4078
authored
Jul 30, 2019
by
Pierre Dittgen
Browse files
Improve wrong headers order message
parent
4326453e
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/views.py
View file @
59ae4078
...
...
@@ -285,7 +285,15 @@ def compute_repair_actions(structure_errors):
# wrong-headers-order
wrong_headers_order
=
[
err
for
err
in
pending_error_list
if
err
[
'code'
]
==
'wrong-headers-order'
]
if
wrong_headers_order
:
action_list
.
append
(
"L'ordre des colonnes du fichier a été rétabli"
)
actual_order
=
wrong_headers_order
[
0
][
'message-data'
][
'actual-order'
]
wanted_order
=
wrong_headers_order
[
0
][
'message-data'
][
'wanted-order'
]
def
field_list_to_str
(
field_list
):
return
', '
.
join
([
"**{}**"
.
format
(
f
)
for
f
in
field_list
])
action_list
.
append
(
"L'ordre des colonnes du fichier a été rétabli (de {} à {})"
.
format
(
field_list_to_str
(
actual_order
),
field_list_to_str
(
wanted_order
)
))
pending_error_list
=
[
err
for
err
in
pending_error_list
if
err
not
in
wrong_headers_order
]
# extra-headers
...
...
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