Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change score calculation from Sum to Avg in ReviewSessionAdmin #4351

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/reviews/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from django import forms
from django.contrib import admin, messages
from django.db.models import Count, F, OuterRef, Prefetch, Subquery, Sum
from django.db.models import Count, F, OuterRef, Prefetch, Subquery, Sum, Avg
from django.http.request import HttpRequest
from django.shortcuts import redirect
from django.template.response import TemplateResponse
Expand Down Expand Up @@ -433,7 +433,7 @@ def _review_proposals_recap_view(self, request, review_session):
proposal_id=OuterRef("id"),
)
.values("proposal_id")
.annotate(score=Sum("score__numeric_value"))
.annotate(score=Avg("score__numeric_value"))
.values("score")
)
)
Expand Down