diff --git a/pretalx_musicrate/__init__.py b/pretalx_musicrate/__init__.py index 17fa713..b7cbe9f 100644 --- a/pretalx_musicrate/__init__.py +++ b/pretalx_musicrate/__init__.py @@ -1 +1 @@ -__version__ = "2025.5.0" +__version__ = "2025.6.0.dev0" diff --git a/pretalx_musicrate/management/commands/computescores.py b/pretalx_musicrate/management/commands/computescores.py index aaa5ef2..11ddd2f 100644 --- a/pretalx_musicrate/management/commands/computescores.py +++ b/pretalx_musicrate/management/commands/computescores.py @@ -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") )