Commit fe575f7f authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Message adjustments

parent 9350a521
/* Custom CSS rules for Validata-UI */
/* Validation report
Customize h2 display in popovers
div.popover h2 {
font-size: 1.4em;
font-weight: bold;
\ No newline at end of file
......@@ -66,10 +66,21 @@ def improve_errors(errors):
# markdown to HTML (with default values for 'title' and 'content')
# Use default values to insure right error display in validation report
# until validata.validate finished its message migration
# Set default title if no title
if not 'title' in err:
update_keys['title'] = '[{}]'.format(err['code'])
if not 'message' in err or err['message'] is None:
# Convert message to markdown only if no content
# => for pre-checks errors
if 'message' in err and not 'content' in err:
update_keys['message'] = commonmark(err['message'])
# Else, default message
elif not 'message' in err or err['message'] is None:
update_keys['message'] = '[{}]'.format(err['code'])
# Message content
md_content = '*content soon available*' if not 'content' in err else err['content']
update_keys['content'] = commonmark(md_content)
......@@ -138,8 +149,6 @@ def create_validata_report(goodtables_report, schema):
rows = []
current_row_id = 0
for err in report['table']['errors']['body']:
if not 'row-number' in err:
print('ERR', err)
row_id = err['row-number']
del err['row-number']
del err['context']
Supports Markdown
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