diff --git a/djangoproject/core/models.py b/djangoproject/core/models.py index bc3791ad..d44fb904 100644 --- a/djangoproject/core/models.py +++ b/djangoproject/core/models.py @@ -420,10 +420,12 @@ def getTotalPaidPriceBTC(self): return self.getTotalPaidPrice_by_currency('BTC') def getTotalPaidPrice_by_currency(self, currency): - offers = Offer.objects.filter(issue=self, status=Offer.PAID, currency=currency) + payments = Payment.objects.filter(status__in=[Payment.CONFIRMED_IPN, Payment.CONFIRMED_TRN], + offer__issue=self, + currency=currency) s = Decimal(0) - for offer in offers: - s = s + offer.price + for payment in payments: + s = s + payment.total return twoplaces(s) def touch(self):