Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload-csv-form-validation-fix-implements-single-submission #238

Merged
merged 11 commits into from
Aug 10, 2024

Conversation

eatyourpeas
Copy link
Member

Overview

Following the merging of @mbarton branch unifying validation across the project into the form classes, the validation then broke. As well as fixes to this, the PR also removes quarter as a field in the Submission model and the implementations in the patient form where this was previously added in. Quarter has been removed also from all the templates

Code changes

  • patient_form.py: removes quarter as a custom field
  • visit_form.py: adds clean_** functions for all the select fields to reject any invalid submitted keys. Accepts None values. TODO: will need to flag errors if for example smoking_status has a valid selection but no associated date.
  • csv_upload.py: removes quarter as parameter to function which had been previously added and all references to it. Refactors Submission creation to set to inactive previous submission before deletes (overwrite previous submissions #235). Refactors Transfer record creation as did not work following change in table structure.
  • submission.py: model refactor - removes quarter
  • changes to templates largely to remove references to quarter
  • mixins.py: adds test for related PDU through the Transfer table
  • views/patient.py: removes references to quarter in filter
  • views/submission.py: removes references to quarter
  • views/visit.py: refactors active_cohort to submission

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

Possibly needs doing still. Needs likely a section on submission but should do this when clearer how quarters will be handled.

Related Issues

Addresses #234, #231

@eatyourpeas eatyourpeas self-assigned this Aug 10, 2024
@eatyourpeas eatyourpeas merged commit 3ca087d into live Aug 10, 2024
1 check passed
@eatyourpeas eatyourpeas deleted the eatyourpeas/issue234 branch August 10, 2024 14:37
@mbarton
Copy link
Member

mbarton commented Aug 10, 2024

Overdue on STAGING (merged by @eatyourpeas 15 minutes and 3 seconds ago) What's gone wrong?

@mbarton
Copy link
Member

mbarton commented Aug 12, 2024

The container is now crashing on startup in the deployment. Annoyingly there aren't any log messages coming from it either. I'll see if I can start it locally

@eatyourpeas
Copy link
Member Author

eatyourpeas commented Aug 12, 2024 via email

@mbarton
Copy link
Member

mbarton commented Aug 12, 2024

Ah yes sorry there is an error it just took a while to come through in the Azure logs:

  Applying npda.0003_alter_submission_options_remove_submission_quarter...
django.db.utils.ProgrammingError: relation "npda_submission" does not exist

@mbarton
Copy link
Member

mbarton commented Aug 14, 2024

Seen on STAGING (merged by @eatyourpeas 90 hours, 52 minutes and 8 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants