Skip to content

Commit

Permalink
Fixed the facility validation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ertush committed Aug 2, 2024
1 parent 3433e98 commit 661db9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions facilities/models/facility_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,13 @@ def push_facility_to_dhis2(self, new_facility_payload, new_facility):
raise ValidationError(
{
"Error!": [
"[DEBUG] new_facility: {}; [DEBUG] new_facility_payload: {}".format(new_facility, new_facility_payload),
"An error occured while creating the facility in KHIS Aggregate. This is may be caused by the "
"existance of an organisation unit with as similar name as to the one you are creating. KHIS Error: {}".format(r.text)
]
}
)
else:
LOGGER.error("new_facility_payload:{}".format(new_facility_payload['id']))
# LOGGER.error("new_facility_payload:{}".format(new_facility_payload['id']))
# raise ValueError("new_facility_payload:{}".format(new_facility_payload))

facility = requests.get(
Expand Down Expand Up @@ -302,8 +301,8 @@ def push_facility_updates_to_dhis2(self, org_unit_id, facility_updates_payload):
)


print("Update Facility Response", r.url, r.status_code, r.json())
LOGGER.info('[DEBUG]: parent_id: {} \n [DEBUG]: payload: {} \n [DEBUG]: response: {}'.format(org_unit_id, facility_updates_payload, r.json()))
# print("Update Facility Response", r.url, r.status_code, r.json())
# LOGGER.info('[DEBUG]: parent_id: {} \n [DEBUG]: payload: {} \n [DEBUG]: response: {}'.format(org_unit_id, facility_updates_payload, r.json()))


if r.json()["status"] != "OK":
Expand Down

0 comments on commit 661db9e

Please sign in to comment.