From 1f09bab3e4c226a6df39efebc6f4f37c6e6cf3bb Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 30 Sep 2017 18:08:02 +0530 Subject: [PATCH] minimum month diff set to 1 --- hosting/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index 5b9645af..e1714094 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -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