Open
Description
election_results.py includes a loop that overwrites a previously declared variable. Script still works but it's a little too confusing for teaching purposes. Change needs to be made below and should be carried over to all elex dirs, branches and tutorial pages to ensure consistency:
for race_key, cand_results in results.items():
all_votes = 0
cands = []
# NOTE: below "results" var should be renamed to "row"
for cand_key, results in cand_results.items():
# Populate a new candidate dict using one set of county results
cand = {
'first_name': results[0]['first_name'],
'last_name': results[0]['last_name'],
'party': results[0]['party'],
'winner': '',
}