Skip to content

Commit

Permalink
additional_data: Use FTC linked_orgs_verified
Browse files Browse the repository at this point in the history
This commit expands the set of org-ids that are considered linked.
FindThatCharity provides multiple options for a set of linked org-ids
per given primary org-id. Previously the datastore used the conservative
"orgIDs" field which included one-way only lookups directly provided by
authorities e.g. the charity commission. This commit switches to the
"linked_orgs_verified" field which expands the official one-way links to
be two-way, and solves the issue of some organisations previously
sharing non-primary org-ids.
  • Loading branch information
R2ZER0 committed Sep 30, 2024
1 parent 4c58016 commit 2280a76
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions datastore/additional_data/sources/find_that_charity.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,20 @@ def process_csv(self, file_data, org_type):
# e.g. A name [with brackets] Association
continue

# Fall back to orgIDs if linked_orgs_verified not available, otherwise a minimal orgIDs array containing
# just the primary orgID.
if "orgIDs" not in row:
row["orgIDs"] = None
row["orgIDs"] = [row["id"]]

if "linked_orgs_verified" not in row:
row["linked_orgs_verified"] = row["orgIDs"]

bulk_list.append(
OrgInfoCache(
data=row, org_type=org_type, org_id=row["id"], org_ids=row["orgIDs"]
data=row,
org_type=org_type,
org_id=row["id"],
org_ids=row["linked_orgs_verified"],
)
)
added += 1
Expand Down

0 comments on commit 2280a76

Please sign in to comment.