diff --git a/mo/web/org_score.py b/mo/web/org_score.py
index 190e5e44911f393116c8f34d6597b0c15a440b87..e1162a798ecd89032b2f62093063944a7e4c88b9 100644
--- a/mo/web/org_score.py
+++ b/mo/web/org_score.py
@@ -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",