Skip to content

Commit

Permalink
Merge pull request #1689 from BLSQ/IA-3470-Have-reference-submissions…
Browse files Browse the repository at this point in the history
…-linked-to-each-Org-unit-in-setuper

IA-3470: Have reference submissions linked to each Org unit in setuper
  • Loading branch information
butofleury authored Oct 11, 2024
2 parents 7a6e2b3 + 7555875 commit 408217e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions setuper/create_submission_with_picture.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ def define_health_facility_reference_form(iaso_client):
f"/api/v2/orgunittypes/{health_facility_type['id']}/", json=health_facility_type
)
form_ids = [form["id"] for form in update_reference_forms.get("reference_forms")]
org_unit_type_reference_forms = {"org_unit_type_id": health_facility_type["id"], "form_ids": form_ids}
org_unit_type_reference_forms = {
"org_unit_type_id": health_facility_type["id"],
"form_ids": form_ids,
"number_of_org_units": health_facility_type["units_count"],
}

return org_unit_type_reference_forms


def create_submission_with_picture(account_name, iaso_client):
print("-- Creating submissions with picture")
form = define_health_facility_reference_form(iaso_client=iaso_client)
# fetch orgunit ids
limit = 10
limit = form["number_of_org_units"]
orgunits = iaso_client.get("/api/orgunits/", params={"limit": limit, "orgUnitTypeId": form["org_unit_type_id"]})[
"orgunits"
]
Expand Down

0 comments on commit 408217e

Please sign in to comment.