-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Cannot use /api/v1/people to create a person if any place in the lineage has an invalid primary contact #8985
Comments
Here are the steps that cause this problem in the ug-vht app:
So this only validates primary contacts if they exist and does not affect all existing places in VHT uganda - just edited places. |
Okay, looking closely at the code change Kenn linked to, the relevant change in logic was an additional validation for a place's primary contact. Originally, when validating a place, if the place had a This causes the observed issues in the ug-vht scenario because they have a parent place with a My main question here is what is the proper "fix" for this issue? It seems kinda confusing to just flag out the |
@kennsippell - throwing this on your AS Sprint project board - we're blocked on your answer. You can remove from project/unassigned when you're done! |
My vote would be to the My personal vote would be to do no validation of any child/descendant under that place (including the primary contact). |
@freddieptf @kennsippell I note that the PR is blocked on a linting error. Is this something we should include in 4.7.0? How close is this to being ready? How can we help? |
@garethbowen the error message on CI isn't really clear to me, both lint and tests passed before i pushed so not sure why they are failing on CI |
@freddieptf The log was hard to find, but buried deep in there it looks like you've broken some tests:
It could be a false negative, but because this is very close to the code you changed it seems legit to me. These should also fail locally if you go to ./shared-libs/contacts and run Let me know if I can help! |
@garethbowen thanks for pointing that out, tests now fixed |
Included in 4.7.0 milestone to get this regression fixed asap. |
Describe the bug
To Reproduce
POST api/v1/people
API to create a person within the parent placeExpected behavior
In 4.4, you could create this person. In 4.6, you see the error
Wrong type, this is not a person.
There is no UUID of the affending contact or place, no hints for a targeted followup. I thought the problem was in my payload; but it is in the hierarchy.
Environment
Additional context
For our Uganda eCHIS app: regions, districts, subdistricts, counties, subcounties all do not have primary contacts. This currently may block cht-user-management from using cht 4.6 via API.
I believe this was changed here
I'll just note that in the real world it's sometimes quite annoying to need a 100% valid hierarchy in order to complete task. When county-level ICT team staff get an error like this and are blocked from creating a user at this place, what are they supposed to do? It's quite burdensome to train every single person creating users in eCHIS to also manage the hierarchy - this app doesn't have forms to create/edit these places or their primary contacts.
The text was updated successfully, but these errors were encountered: