From 125730569bfb6a3d7d9abfdeec6b6ae33d5795f5 Mon Sep 17 00:00:00 2001 From: Etzelia Date: Thu, 6 Dec 2018 18:00:57 +0100 Subject: [PATCH] Average age only needs accepted applications --- overview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overview.py b/overview.py index 3cd626b..3508606 100644 --- a/overview.py +++ b/overview.py @@ -39,8 +39,8 @@ def overview_data(): # Averages data['average'] = { - 'age': round(sum([application.age for application in Application.objects.all()]) / - data['total']['application']['all'] if data['total']['application']['all'] != 0 else 1, 2) + 'age': round(sum([application.age for application in Application.objects.filter(accepted=True)]) / + data['total']['application']['accepted'] if data['total']['application']['accepted'] != 0 else 1, 2) } # Percentage