rcpch / rcpch-audit-engine

Epilepsy12 Audit Platform
https://e12.rcpch.ac.uk/
GNU Affero General Public License v3.0
5 stars 4 forks source link

Eatyourpeas/all-rcpch-access-to-disabled-records #972

Closed eatyourpeas closed 2 months ago

eatyourpeas commented 2 months ago

Overview

The E12 would like to be able to edit records which are disabled as are in a historical cohort (eg 5). This used to happen in error when users put in a first paediatric assessment date that was wrong, but now the minimum date for users to select is the start of the currently submitting cohort.

In the course of investigating this it was discovered that the Django admin Registration, KPI and AuditProgress would not render if there were orphan records. This PR therefore also fixes:

  1. cascade case deletions to include AuditProgress and KPI related records
  2. Admin template rendering if orphan records present

Code changes

Update to documentation to clarify first paediatric assessment date minimum values for users

Fix AuditProgress and KPI and Registration models to return sensible string even if orphan records

Fix case_views.py to cascade deletes to to KPI and AuditProgress related records

Update case_table partial to allow RCPCH users access to disabled records

Documentation changes (done or required as a result of this PR)

Please describe any changes to documentation here.

Related Issues

List any issues related to this PR here.

Mentions

@mentions of the person or team responsible for reviewing proposed changes.