minimum month diff set to 1
This commit is contained in:
parent
3701899304
commit
1f09bab3e4
1 changed files with 1 additions and 1 deletions
|
@ -177,6 +177,6 @@ class VMDetail(models.Model):
|
||||||
|
|
||||||
def end_date(self):
|
def end_date(self):
|
||||||
end_date = self.terminated_at if self.terminated_at else timezone.now()
|
end_date = self.terminated_at if self.terminated_at else timezone.now()
|
||||||
months = relativedelta(end_date, self.created_at).months
|
months = relativedelta(end_date, self.created_at).months or 1
|
||||||
end_date = self.created_at + relativedelta(months=months)
|
end_date = self.created_at + relativedelta(months=months)
|
||||||
return end_date
|
return end_date
|
||||||
|
|
Loading…
Reference in a new issue