From 3701899304149cbc6bd5a4b05c5d38269e8508ca Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 30 Sep 2017 18:06:50 +0530 Subject: [PATCH] timezone aware --- hosting/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index db68f522..5b9645af 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 = relativedelta(end_date, self.created_at).months end_date = self.created_at + relativedelta(months=months) return end_date