This PR saves any errors returned from csv validation and stores them in the Submission model as JSON. It the deserializes them and renders a summary in the data quality report table below the submission list view.
There is also a fix to refresh the session when landing on the dashboard in case can_upload_csv or can_complete_questionnaire status has changed
Code changes
Includes a new submission_errors field in the Submission model and associated migration.
New serialize_errors function to convert the error list object to json and import in __init__.py
This is called in home.py on successful upload.
Deserialization occurs in the submission listview (get_context method) and stores the object in context
New table in the data_quality_report.html template to iterate through the errors object and generate a table.
New template tags to retrieve the CSV heading from the model name
Related Issues
There is actually no issue strangely for this feature, but really should have been.
Ideally this list of errors should be added as a separate sheet to the excel sheet for download also - I will raise a separate issue for this
Overview
This PR saves any errors returned from csv validation and stores them in the
Submission
model as JSON. It the deserializes them and renders a summary in the data quality report table below the submission list view.There is also a fix to refresh the session when landing on the dashboard in case
can_upload_csv
orcan_complete_questionnaire
status has changedCode changes
Includes a new
submission_errors
field in theSubmission
model and associated migration. Newserialize_errors
function to convert the error list object to json and import in__init__.py
This is called inhome.py
on successful upload. Deserialization occurs in the submission listview (get_context
method) and stores the object in context New table in thedata_quality_report.html
template to iterate through the errors object and generate a table. New template tags to retrieve the CSV heading from the model nameRelated Issues
There is actually no issue strangely for this feature, but really should have been.
Ideally this list of errors should be added as a separate sheet to the excel sheet for download also - I will raise a separate issue for this