Remove unused chart functionality

This commit is contained in:
2023-10-08 21:08:03 +02:00
parent 865ecd1ee0
commit 2eaccc57b0
3 changed files with 19 additions and 168 deletions

View File

@ -1,15 +1,8 @@
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Count, F, Prefetch, Sum
from django.db.models.functions import TruncDate
from django.http import (
HttpRequest,
HttpResponse,
HttpResponseBadRequest,
HttpResponseRedirect,
)
from common.time import now as now_with_tz
from django.conf import settings
from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils import timezone
@ -298,10 +291,8 @@ def list_sessions(
context["total_duration"] = dataset.total_duration_formatted()
context["dataset"] = dataset
try:
context["last"] = Session.objects.latest()
except ObjectDoesNotExist:
context["last"] = None
# cannot use dataset[0] here because that might be only partial QuerySet
context["last"] = Session.objects.all().order_by("timestamp_start").last()
return render(request, "list_sessions.html", context)