Compare commits

...

2 Commits

Author SHA1 Message Date
Luca 1b264054fc chore: bump version
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2025-02-23 17:46:19 +01:00
Luca c5b39e1890 feat(computescores): add option to include frozen jurors 2025-02-23 17:45:55 +01:00
2 changed files with 13 additions and 6 deletions

View File

@ -1 +1 @@
__version__ = "2025.5.0"
__version__ = "2025.6.0"

View File

@ -20,6 +20,9 @@ class Command(BaseCommand):
help = "Compute submission scores from ratings"
def add_arguments(self, parser):
parser.add_argument(
"-a", "--all", action="store_true", help="include frozen jurors", type=bool
)
parser.add_argument("event")
def handle(self, *args, **kwargs):
@ -31,11 +34,15 @@ class Command(BaseCommand):
with scope(event=event):
submissions = {}
for juror in (
event.jurors.prefetch_related("ratings__submission")
.filter(frozen=False)
.order_by("token")
):
jurors = event.jurors.prefetch_related("ratings__submission").order_by(
"token"
)
if not kwargs["all"]:
jurors = jurors.filter(frozen=False)
self.stderr.write(f"computing scores from {jurors.count()} jurors")
for juror in jurors:
ratings = list(
juror.ratings.exclude(rating="").order_by("submission__created")
)