Linting fixes.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-22 13:36:49 -04:00
parent 410e6c9e48
commit 23acc006d4
9 changed files with 13 additions and 24 deletions

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -133,5 +133,3 @@ class Command(BaseCommand):
milestone=milestone
).save()
start = end

View File

@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import timedelta
from django import template
from core.models import Timer

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -23,8 +23,8 @@ urlpatterns = [
name='diaperchange-add'),
url(r'^changes/(?P<pk>[0-9]+)/$', views.DiaperChangeUpdate.as_view(),
name='diaperchange-update'),
url(r'^changes/(?P<pk>[0-9]+)/delete/$', views.DiaperChangeDelete.as_view(),
name='diaperchange-delete'),
url(r'^changes/(?P<pk>[0-9]+)/delete/$',
views.DiaperChangeDelete.as_view(), name='diaperchange-delete'),
url(r'^feedings/$', views.FeedingList.as_view(), name='feeding-list'),
url(r'^feedings/add/$', views.FeedingAdd.as_view(), name='feeding-add'),
@ -55,11 +55,12 @@ urlpatterns = [
url(r'^timer/(?P<pk>[0-9]+)/delete/$', views.TimerDelete.as_view(),
name='timer-delete'),
url(r'^tummy-time/$', views.TummyTimeList.as_view(), name='tummytime-list'),
url(r'^tummy-time/$', views.TummyTimeList.as_view(),
name='tummytime-list'),
url(r'^tummy-time/add/$', views.TummyTimeAdd.as_view(),
name='tummytime-add'),
url(r'^tummy-time/(?P<pk>[0-9]+)/$', views.TummyTimeUpdate.as_view(),
name='tummytime-update'),
url(r'^tummy-time/(?P<pk>[0-9]+)/delete/$', views.TummyTimeDelete.as_view(),
name='tummytime-delete'),
url(r'^tummy-time/(?P<pk>[0-9]+)/delete/$',
views.TummyTimeDelete.as_view(), name='tummytime-delete'),
]

View File

@ -61,9 +61,13 @@ def card_tummytime_last(child):
def card_tummytime_day(child, date=timezone.now().date()):
instances = TummyTime.objects.filter(
child=child, end__day=date.day).order_by('-end')
stats = {'total': timezone.timedelta(seconds=0), 'count': instances.count()}
stats = {
'total': timezone.timedelta(seconds=0),
'count': instances.count()
}
for instance in instances:
stats['total'] += timezone.timedelta(seconds=instance.duration_td().seconds)
stats['total'] += timezone.timedelta(
seconds=instance.duration_td().seconds)
return {'stats': stats, 'instances': instances, 'last': instances.first()}

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -15,7 +15,7 @@ gulp.task('lint:python', function(cb) {
[
'run',
'flake8',
'--exclude=node_modules,migrations'
'--exclude=migrations,manage.py,node_modules,settings'
],
{
stdio: 'inherit'

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.