1
0
mirror of https://github.com/daniviga/bite.git synced 2024-12-23 00:31:25 +01:00

Fix first and last sample

This commit is contained in:
Daniele Viganò 2020-06-30 22:35:20 +02:00
parent fe61ebbd9d
commit b1d0f35cf7
Signed by: dani
GPG Key ID: DB49AFC03C40EE02

View File

@ -47,9 +47,9 @@ class TelemetrySummaryView(APIView):
if count == 0:
raise Http404
first = Telemetry.objects.filter(
device__serial=device).order_by('-time')[:1][0]
last = Telemetry.objects.filter(
device__serial=device).order_by('time')[:1][0]
last = Telemetry.objects.filter(
device__serial=device).order_by('-time')[:1][0]
data = {
'device': device,
'stats': {