voteview: when looking up the IDs of presidents use the icpsr_prez field because these IDs are not the same as the IDs for Members of Congress when they are in Congress

This commit is contained in:
Joshua Tauberer
2013-12-21 16:01:39 -05:00
parent dda61f406f
commit a6add00508

View File

@@ -311,7 +311,7 @@ def parse_vote_list_file(vote_list_file):
icpsr_id = vote_info["icpsr_id"]
try:
bioguide_id = utils.get_person_id("icpsr", icpsr_id, "bioguide")
bioguide_id = utils.get_person_id("icpsr" if vote_info["state_name"] != "USA" else "icpsr_prez", icpsr_id, "bioguide")
except KeyError as e:
logging.error("Problem with member %s ([%d] %s) of %s %s: %s" % ( vote_info["member_name"], vote_info["icpsr_party"], vote_info["party"],
vote_info["state_name"], vote_info["district"], e.message ))