Skip to content

Commit ece2a52

Browse files
committed
backout itbill quantity calc
1 parent c43246a commit ece2a52

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

endorsement/models/itbill.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ def get_quota_on_date(self, now):
9999
Walks Provisions list to return the subscribed quota
100100
associated with the given date
101101
"""
102-
current_quantity = 0
103102
if self.state == self.SUBSCRIPTION_DEPLOYED:
104103
for provision in self.get_provisions():
105104
for quantity in provision.get_quantities():
106-
if (quantity.start_date <= now
107-
and (quantity.end_date is None
108-
or quantity.end_date >= now)):
109-
current_quantity += quantity.quantity_gigabytes
105+
if quantity.start_date <= now:
106+
if (quantity.end_date is None
107+
or quantity.end_date >= now):
108+
return quantity.quantity_gigabytes
110109

111-
return current_quantity if current_quantity else None
110+
return None
112111

113112
def json_data(self):
114113
return {

0 commit comments

Comments
 (0)