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

Fix adding patients outside of Jersey #1191

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

mbarton
Copy link
Member

@mbarton mbarton commented Jan 28, 2025

Fixes #1190

Patients outside of Jersey have nhs_number, not unique_reference_number. However they were ending up with their URN being the empty string (Django convention). This then broke the unique_together constraint.

This PR adds a cleaner to convert the empty strings to null, following the suggestion here: https://stackoverflow.com/questions/5772176/django-unique-together-and-blank-true.

We don't have the problem in reverse as we already null out the NHS number for Jersey patients in the respective cleaner.

@mbarton mbarton self-assigned this Jan 28, 2025
@mbarton mbarton merged commit 284f672 into live Jan 28, 2025
2 checks passed
@mbarton mbarton deleted the mbarton/hotfix-creating-patients branch January 28, 2025 12:57
@mbarton
Copy link
Member Author

mbarton commented Jan 28, 2025

Seen on STAGING (merged by @mbarton 28 minutes and 55 seconds ago) Please check your changes!

@mbarton
Copy link
Member Author

mbarton commented Jan 28, 2025

Seen on LIVE (merged by @mbarton 29 minutes 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.

Users unable to enter new patients on the Platform
1 participant