Skip to content

Commit

Permalink
Fixed semester and series freeze (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmasrna1 authored Nov 24, 2024
1 parent 699de07 commit 52e2685
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions competition/results.py
Original file line number Diff line number Diff line change
@@ -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"""
Expand All @@ -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):
Expand All @@ -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(
Expand Down

0 comments on commit 52e2685

Please sign in to comment.