From 5d35910b4def8040e194b914e47d87a0d5bb03ea Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 11 Feb 2022 21:03:14 +0000 Subject: [PATCH] Fix running cut time bug --- apiserver/apiserver/api/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 9887cda..fd89e38 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -766,10 +766,10 @@ class StatsViewSet(viewsets.ViewSet, List): today_total = device_uses.filter( 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( 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: track = cache.get('track', {})[device]