Skip to content
Snippets Groups Projects

Vylepšení výsledkové listiny

Merged Martin Mareš requested to merge mj/vysledky-p into devel
1 unresolved thread
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
+ 5
4
@@ -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",
Loading