Browse files

Fixed crash when FEC contributor name null.

  • Loading branch information...
1 parent 7ec3251 commit 31b3e3bf61cd36d5e49f58f545366909dd647838 Ethan Phelps-Goodman committed Apr 4, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 influence/views.py
View
6 influence/views.py
@@ -272,8 +272,10 @@ def org_contribution_section(entity_id, standardized_name, cycle, amount, type,
section['fec_summary'] = api.org.fec_summary(entity_id)
if section['fec_summary']:
section['fec_summary']['clean_date'] = datetime.datetime.strptime(section['fec_summary']['date'], "%Y-%m-%d")
- section['fec_top_contribs_data'] = json.dumps([dict(key=generate_label(row['contributor_name'], 27), value=row['amount'], href='')
- for row in api.org.fec_top_contribs(entity_id)])
+ section['fec_top_contribs_data'] = \
+ json.dumps([dict(key=generate_label(row['contributor_name'] if row['contributor_name'] else '<Name Missing>', 27),
+ value=row['amount'], href='')
+ for row in api.org.fec_top_contribs(entity_id)])
section['fec_indexp'] = api.org.fec_indexp(entity_id)[:10]

0 comments on commit 31b3e3b

Please sign in to comment.