Commit 62e6a8a9 authored by David Seaward's avatar David Seaward

credit label update:

* fix reference to new enum
* add months and years to label
parent bed71975
......@@ -77,7 +77,7 @@ class Limit(models.Model):
def credit_label(self):
if self.service == "TUNNEL":
if self.service == Service.TUNNEL:
return self.days_credit_label()
else:
return self.days_credit_label()
......@@ -86,7 +86,13 @@ class Limit(models.Model):
single_day = 60 * 60 * 24
days = int(round(delta.total_seconds() / single_day))
return str(days) + " days"
if days <= 62:
return str(days) + " days"
elif days <= 744:
return str(days // 30) + " months"
else:
return str(days // 365) + " years"
def days_credit_label(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment