Skip to content
Snippets Groups Projects
Commit a5088569 authored by Martin Mareš's avatar Martin Mareš
Browse files

org_score: Typování

parent 40c8ebad
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ class SolPointsCell(Cell): ...@@ -41,7 +41,7 @@ class SolPointsCell(Cell):
user: db.User user: db.User
sol: Optional[db.Solution] sol: Optional[db.Solution]
def __init__(self, contest_id: int, user: db.User, sol: db.Solution): def __init__(self, contest_id: int, user: db.User, sol: Optional[db.Solution]):
self.contest_id = contest_id self.contest_id = contest_id
self.user = user self.user = user
self.sol = sol self.sol = sol
...@@ -159,14 +159,15 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None): ...@@ -159,14 +159,15 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None):
'user': user, 'user': user,
'email': user.email, 'email': user.email,
'participant': cell_pion_link(user, local_pion_ct_id, user.full_name()), 'participant': cell_pion_link(user, local_pion_ct_id, user.full_name()),
'contest': CellLink(pion.contest.place.name, url_for('org_contest', id=pion.contest_id)), 'contest': CellLink(pion.contest.place.name or "?", url_for('org_contest', id=pion.contest_id)),
'pion_place': pion.place.name, 'pion_place': pion.place.name,
'school': CellLink(school.name, url_for('org_place', id=school.place_id)), 'school': CellLink(school.name or "?", url_for('org_place', id=school.place_id)),
'grade': pant.grade, 'grade': pant.grade,
'total_points': result.get_total_points(), 'total_points': result.get_total_points(),
'birth_year': pant.birth_year, 'birth_year': pant.birth_year,
'order_key': result._order_key, 'order_key': result._order_key,
}) })
sols = result.get_sols_map() sols = result.get_sols_map()
for task in tasks: for task in tasks:
local_sol_ct_id = subcontest_id_map[(task.round_id, pion.contest_id)] local_sol_ct_id = subcontest_id_map[(task.round_id, pion.contest_id)]
...@@ -180,7 +181,7 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None): ...@@ -180,7 +181,7 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None):
table_rows.append(row) table_rows.append(row)
filename = f"vysledky_{round.year}-{round.category}-{round.level}" filename = f"vysledky_{round.year}-{round.category}-{round.level}"
if contest_id: if contest:
filename += f"_oblast_{contest.place.code or contest.place.place_id}" filename += f"_oblast_{contest.place.code or contest.place.place_id}"
table = Table( table = Table(
table_class="data full center", table_class="data full center",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment