Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop validating repeat phone numbers on offices #121

Merged
merged 5 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions openstates/data/models/people_orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,11 @@ def __str__(self):

OFFICE_CHOICES = (
("district", "District Office"),
("district-mail", "District Mailing Address"),
("capitol", "Capitol Office"),
("capitol-mail", "Capitol Mailing Address"),
("primary", "Primary Office"),
("home", "Home"),
)


Expand Down
2 changes: 1 addition & 1 deletion openstates/utils/people/lint_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def validate_offices(person: Person) -> list[str]:
for office in person.offices:
type_counter[office.classification] += 1
for key, value in office.dict().items():
if key == "classification" or not value:
if key == "classification" or key == "voice" or key == "fax" or not value:
continue
# reverse lookup to see if we've used this phone number/etc. before
location_str = f"{office.classification} {key}"
Expand Down
9 changes: 0 additions & 9 deletions openstates/utils/tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@ def test_validate_roles_retired(roles, expected):
],
[],
),
(
[
{"classification": "district", "voice": "123-444-4444"},
{"classification": "capitol", "voice": "123-444-4444"},
],
[
"Value '123-444-4444' used multiple times: district voice and capitol voice"
],
),
],
)
def test_validate_offices(offices, expected):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openstates"
version = "6.18.0"
version = "6.18.1"
description = "core infrastructure for the openstates project"
authors = ["James Turk <dev@jamesturk.net>"]
license = "MIT"
Expand Down