Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ZA] Fix intermittent problem with Ward Councillor lookups
This code was making a bad assumption about the order of things in the response from the code4sa mapit API. It was assuming that ward would always come first, and then municipality. But it seems that was not the case, the order of results from mapit is actually random and shouldn't be relied on. So this change adds some extra checks to ensure we're using the correct bits of the JSON for the ward and municipality.
- Loading branch information