Commit 59ae4078 authored by Pierre Dittgen's avatar Pierre Dittgen

Improve wrong headers order message

parent 4326453e
......@@ -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
......
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