rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

data-quality-report-csv-errors #369

Closed eatyourpeas closed 2 weeks ago

eatyourpeas commented 2 weeks ago

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 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

eatyourpeas commented 2 weeks ago
image
mbarton commented 2 weeks ago

Seen on STAGING (merged by @eatyourpeas 5 minutes and 30 seconds ago) Please check your changes!