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()}