X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/dce88babe4ba454ab67da205cacc5441c4953809..7a8610e5869654bd2e8351b34b9e722ce6de73bd:/src/funding/views.py diff --git a/src/funding/views.py b/src/funding/views.py index 9b4378062..5be8c4b89 100644 --- a/src/funding/views.py +++ b/src/funding/views.py @@ -51,20 +51,15 @@ class WLFundView(TemplateView): offers = [] for o in Offer.past(): - if o.is_win(): - o.wlfund = o.sum() - o.target - if o.wlfund > 0: - offers.append(o) - else: - o.wlfund = o.sum() - if o.wlfund > 0: - offers.append(o) + o.wlfund = o.sum() + if o.wlfund > 0: + offers.append(o) amount = sum(o.wlfund for o in offers) - sum(o.amount for o in Spent.objects.all()) ctx['amount'] = amount ctx['log'] = add_total(amount, mix( - (offers, lambda x: x.end, 'offer'), (Spent.objects.all().select_related(), lambda x: x.timestamp, 'spent'), + (offers, lambda x: x.end, 'offer'), )) return ctx