Permalink
Browse files

sort candidates and incumbents for testability

  • Loading branch information...
1 parent 6a2bc5e commit 3e0cadeacb0dcabf9c640c90aeed9e013c661e5b pw@slinktopp committed Aug 18, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 purplevoter/controllers/people.py
@@ -44,8 +44,8 @@ def _to_json(obj):
'election': obj.election.name,
'election_stagename': obj.election.stagename,
'election_date': obj.election.date,
- 'candidates': obj.candidates,
- 'incumbents': obj.incumbents,
+ 'candidates': sorted(obj.candidates, key=lambda x: x.fullname),
+ 'incumbents': sorted(obj.incumbents, key=lambda x: x.fullname),
}
return info
else:

0 comments on commit 3e0cade

Please sign in to comment.