Skip to content

Commit

Permalink
Update variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexobaseki committed Sep 27, 2024
1 parent 560b27b commit e004d87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openstates/importers/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def limit_spec(self, spec: _JsonDict) -> _JsonDict:
if name:
# __icontains doesn't work for JSONField ArrayField
# so other_names follows "title" naming pattern
other_names = name.title().replace(" On ", " on ")
other_name_lowercase_on = name.title().replace(" On ", " on ")
return Q(**spec) & (
Q(name__iexact=name) | Q(other_names__contains=[{"name": other_names}])
Q(name__iexact=name)
| Q(other_names__contains=[{"name": other_name_lowercase_on}])
)
return spec

0 comments on commit e004d87

Please sign in to comment.