Skip to content

Commit 930eeb7

Browse files
committed
Bugfix for address listings in state legislator CSVs
issues/1392 type:bug component:infrastructure - openstates/cli/people.py Updated the definition of the person objects from the YAML data to properly populate the capitol address info in the final objects. Updated the address population logic to include "capitol-mail" and "district-mail" if available.
1 parent c3ba999 commit 930eeb7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

openstates/cli/people.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,19 @@ def write_csv(files: list[Path], jurisdiction_id: str, output_filename: str) ->
205205
district_address = district_voice = district_fax = None
206206
capitol_address = capitol_voice = capitol_fax = None
207207
for cd in person.offices:
208-
if cd.classification == "district":
208+
if cd.classification == "district-mail":
209+
district_address = cd.address
210+
district_voice = cd.voice
211+
district_fax = cd.fax
212+
elif cd.classification == "district":
209213
district_address = cd.address
210214
district_voice = cd.voice
211215
district_fax = cd.fax
212-
elif cd.classification == "district":
216+
elif cd.classification == "capitol-mail":
217+
capitol_address = cd.address
218+
capitol_voice = cd.voice
219+
capitol_fax = cd.fax
220+
elif cd.classification == "capitol":
213221
capitol_address = cd.address
214222
capitol_voice = cd.voice
215223
capitol_fax = cd.fax

0 commit comments

Comments
 (0)