Skip to content

Commit

Permalink
Fix for PACs
Browse files Browse the repository at this point in the history
  • Loading branch information
evz committed Dec 7, 2018
1 parent 2510fbf commit 0f89cc7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions camp_fin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,14 +1131,15 @@ def get_context_data(self, **kwargs):

context['latest_filing'] = latest_filing

total_loans = latest_filing.total_loans or 0
total_inkind = latest_filing.total_inkind or 0

# Count pure donations, if applicable
if latest_filing and (total_loans > 0 or total_inkind > 0):
donations = latest_filing.total_contributions - (latest_filing.total_loans +
latest_filing.total_inkind)
context['donations'] = donations
if latest_filing:
total_loans = latest_filing.total_loans or 0
total_inkind = latest_filing.total_inkind or 0

# Count pure donations, if applicable
if total_loans > 0 or total_inkind > 0:
donations = latest_filing.total_contributions - (latest_filing.total_loans +
latest_filing.total_inkind)
context['donations'] = donations

return context

Expand Down

0 comments on commit 0f89cc7

Please sign in to comment.