Update naps card to pass timedelta directly.

This commit is contained in:
Christopher Charbonneau Wells 2017-11-19 11:01:38 -05:00
parent 31f747e908
commit 5a57ac7a48
2 changed files with 2 additions and 2 deletions

View File

@ -14,5 +14,5 @@
{% endblock %}
{% block content %}
{% if total.duration__sum %}{{ total.duration__sum|duration_string }}{% endif %}
{% if total %}{{ total|duration_string }}{% endif %}
{% endblock %}

View File

@ -148,7 +148,7 @@ def card_sleep_naps_day(child, date=None):
instances = models.Sleep.naps.filter(child=child, start__date=date)
return {
'type': 'sleep',
'total': instances.aggregate(Sum('duration')),
'total': instances.aggregate(Sum('duration'))['duration__sum'],
'count': len(instances)}