This commit is contained in:
Alysia Broddrick 2024-03-07 20:33:22 -08:00
parent d1bac52aa6
commit bd35244396
No known key found for this signature in database
GPG key ID: 03917052CD0F06B7

View file

@ -377,11 +377,10 @@ def analytics(request):
).aggregate(Avg("approval_time"))["approval_time__avg"] ).aggregate(Avg("approval_time"))["approval_time__avg"]
# Format the timedelta to display only days # Format the timedelta to display only days
if avg_approval_time is not None: if avg_approval_time is not None:
avg_approval_time = f"{avg_approval_time.days} days" avg_approval_time = f"{avg_approval_time.days} days"
else: else:
avg_approval_time="No approvals to use" avg_approval_time = "No approvals to use"
# The start and end dates are passed as url params # The start and end dates are passed as url params
start_date = request.GET.get("start_date", "") start_date = request.GET.get("start_date", "")
end_date = request.GET.get("end_date", "") end_date = request.GET.get("end_date", "")