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

Fixed semester and series freeze #454

Merged
merged 1 commit into from
Nov 24, 2024
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
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