Skip to content

Commit

Permalink
Merge pull request #137 from openstates/update-organization-other-nam…
Browse files Browse the repository at this point in the history
…es-lookup

Update organization other_names lookup
  • Loading branch information
alexobaseki committed Aug 27, 2024
2 parents ec0f5e5 + 466e799 commit 12272b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openstates/importers/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ def limit_spec(self, spec: _JsonDict) -> _JsonDict:

name = spec.pop("name", None)
if name:
return Q(**spec) & (Q(other_names__0__name=name) | Q(name=name))
return Q(**spec) & (
Q(name=name) | Q(other_names__contains=[{"name": name}])
)
return spec

0 comments on commit 12272b0

Please sign in to comment.