X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/dac9a35e0d86c0ec50f33d69d73be5d7ae7ae7ef..72959c8d0c74c83da56f8b1a86ec6d915d3fe57c:/apps/funding/views.py diff --git a/apps/funding/views.py b/apps/funding/views.py index 7bc822677..bf2a073dc 100644 --- a/apps/funding/views.py +++ b/apps/funding/views.py @@ -8,7 +8,6 @@ from django.conf import settings from django.core.urlresolvers import reverse from django.http import Http404 from django.shortcuts import redirect, get_object_or_404 -from django.utils.decorators import method_decorator from django.views.generic import TemplateView, FormView, DetailView, ListView import getpaid.backends.payu from getpaid.models import Payment @@ -63,12 +62,11 @@ class WLFundView(TemplateView): if o.wlfund > 0: offers.append(o) amount = sum(o.wlfund for o in offers) - sum(o.amount for o in Spent.objects.all()) - print offers ctx['amount'] = amount ctx['log'] = add_total(amount, mix( (offers, lambda x: x.end, 'offer'), - (Spent.objects.all(), lambda x: x.timestamp, 'spent'), + (Spent.objects.all().select_related(), lambda x: x.timestamp, 'spent'), )) return ctx