File tree Expand file tree Collapse file tree
app/grandchallenge/challenges Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -938,26 +938,16 @@ def has_paid_prepaid_invoice(self):
938938 payment_status = PaymentStatusChoices .PAID ,
939939 ).exists ()
940940
941- @cached_property
942- def compute_costs_balance_euros_millicents (self ):
943- return self ._get_compute_costs_balance_euros_millicents (
944- invoices = self .invoices .all ()
945- )
941+ @property
942+ def active_invoice (self ):
943+ invoices = self .invoices .order_by ("expires_on" , "created" )
946944
947- def _get_compute_costs_balance_euros_millicents (self , * , invoices ):
948- return sum (
945+ total_balance = sum (
949946 invoice .compute_costs_balance_euros_millicents
950947 for invoice in invoices
951948 )
952949
953- @property
954- def active_invoice (self ):
955- invoices = self .invoices .order_by ("expires_on" , "created" )
956-
957- if (
958- self ._get_compute_costs_balance_euros_millicents (invoices = invoices )
959- <= 0
960- ):
950+ if total_balance <= 0 :
961951 raise InsufficientBudgetError
962952
963953 for invoice in invoices :
You can’t perform that action at this time.
0 commit comments