Fix running cut time bug
This commit is contained in:
parent
ec169e6dc7
commit
5d35910b4d
|
@ -766,10 +766,10 @@ class StatsViewSet(viewsets.ViewSet, List):
|
||||||
|
|
||||||
today_total = device_uses.filter(
|
today_total = device_uses.filter(
|
||||||
user=user, started_at__gte=today_start, deleted_at__isnull=True,
|
user=user, started_at__gte=today_start, deleted_at__isnull=True,
|
||||||
).aggregate(Sum('num_seconds'))['num_seconds__sum'] + running_cut_time
|
).aggregate(Sum('num_seconds'))['num_seconds__sum'] or 0 + running_cut_time
|
||||||
month_total = device_uses.filter(
|
month_total = device_uses.filter(
|
||||||
user=user, started_at__gte=month_start, deleted_at__isnull=True,
|
user=user, started_at__gte=month_start, deleted_at__isnull=True,
|
||||||
).aggregate(Sum('num_seconds'))['num_seconds__sum'] + running_cut_time
|
).aggregate(Sum('num_seconds'))['num_seconds__sum'] or 0 + running_cut_time
|
||||||
|
|
||||||
try:
|
try:
|
||||||
track = cache.get('track', {})[device]
|
track = cache.get('track', {})[device]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user