diff --git a/competition/results.py b/competition/results.py index e99d745..f57dadf 100644 --- a/competition/results.py +++ b/competition/results.py @@ -1,9 +1,11 @@ -from json import loads as json_loads, dumps as json_dumps -from competition.utils import sum_methods -from competition.serializers import EventRegistrationReadSerializer -from competition.models import Series, Semester, EventRegistration +from json import dumps as json_dumps +from json import loads as json_loads from operator import itemgetter +from competition.models import EventRegistration, Semester, Series +from competition.serializers import EventRegistrationReadSerializer +from competition.utils import sum_methods + class FreezingNotClosedResults(Exception): """Snažíš sa zamraziť výsledky série, ktorá nemá opravené všetky riešenia""" @@ -27,6 +29,7 @@ def freeze_semester_results(semester: Semester): raise FreezingNotClosedResults() semester.frozen_results = json_dumps(semester_results(semester)) + semester.save() def series_results(series: Series): @@ -47,7 +50,8 @@ def freeze_series_results(series: Series): ): raise FreezingNotClosedResults() - series.frozen_results = json_dumps(series.results) + series.frozen_results = json_dumps(series_results(series)) + series.save() def generate_praticipant_invitations(