From e2f9403466757e1e90e0e3c6f61144ce1c3772e1 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 15 Jul 2023 19:12:11 +0000 Subject: [PATCH] Fix monthly hosting Sum bug --- apiserver/apiserver/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 8719205..57ef89e 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -1830,7 +1830,7 @@ class HostingViewSet(Base): members = models.Member.objects.all() members = members.annotate( - hosting_hours=Max('user__hosting__hours', filter=Q(user__hosting__finished_at__gte=current_month_start)), + hosting_hours=Sum('user__hosting__hours', filter=Q(user__hosting__finished_at__gte=current_month_start)), ).exclude(hosting_hours__isnull=True).order_by('-hosting_hours') scores = []