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

Patient.save called twice during update #335

Open mbarton opened 3 weeks ago

mbarton commented 3 weeks ago

https://github.com/rcpch/national-paediatric-diabetes-audit/blob/65fd924a03295a0be27e397eab86f84d8838ae5f/project/npda/views/patient.py#L322

super().form_valid(form) will also call patient.save.

I noticed this because I saw two calls to imd_for_postcode. After #325 we calculate imd in PatientForm.save so this is less of an issue - fixing it would just save a database call.