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
This commit is part of merge request !36. Comments created here will be created in the context of that merge request.
......@@ -41,7 +41,7 @@ class SolPointsCell(Cell):
user: db.User
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.user = user
self.sol = sol
......@@ -159,14 +159,15 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None):
'user': user,
'email': user.email,
'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,
'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,
'total_points': result.get_total_points(),
'birth_year': pant.birth_year,
'order_key': result._order_key,
})
sols = result.get_sols_map()
for task in tasks:
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):
table_rows.append(row)
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}"
table = Table(
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