From 05e9927d7457c1a438fa73011e1acbb441292f6a Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Wed, 25 Oct 2017 09:45:53 -0400 Subject: [PATCH] Remove unnecessary "duration_td" Tummy Time method. --- core/models.py | 3 --- dashboard/templatetags/cards.py | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/core/models.py b/core/models.py index d0cabe85..0c67ea07 100644 --- a/core/models.py +++ b/core/models.py @@ -202,9 +202,6 @@ class TummyTime(models.Model): def __str__(self): return 'Tummy Time' - def duration_td(self): - return self.end - self.start - def save(self, *args, **kwargs): if self.start and self.end: self.duration = self.end - self.start diff --git a/dashboard/templatetags/cards.py b/dashboard/templatetags/cards.py index 70d55e9b..e1f90704 100644 --- a/dashboard/templatetags/cards.py +++ b/dashboard/templatetags/cards.py @@ -155,6 +155,5 @@ def card_tummytime_day(child, date=None): 'count': instances.count() } for instance in instances: - stats['total'] += timezone.timedelta( - seconds=instance.duration_td().seconds) + stats['total'] += timezone.timedelta(seconds=instance.duration.seconds) return {'stats': stats, 'instances': instances, 'last': instances.first()}