minimum month diff set to 1

This commit is contained in:
Arvind Tiwari 2017-09-30 18:08:02 +05:30
parent 3701899304
commit 1f09bab3e4

View file

@ -177,6 +177,6 @@ class VMDetail(models.Model):
def end_date(self):
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)
return end_date