diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py index 83e7f6613fc2772dc00e9eb58db43c2c5a842981..6ad6f10a1fc3c28100bd51658b2ba5801c9c119a 100644 --- a/mo/web/org_contest.py +++ b/mo/web/org_contest.py @@ -26,7 +26,7 @@ from mo.web import app import mo.web.fields as mo_fields import mo.web.util from mo.web.util import PagerForm -from mo.web.table import CellCheckbox, Table, Row, Column, cell_pion_link, cell_place_link, cell_email_link, cell_email_link_flags +from mo.web.table import CellCheckbox, Table, Row, Column, cell_contest_place_link, cell_pion_link, cell_place_link, cell_email_link, cell_email_link_flags import wtforms.validators as validators from wtforms.widgets.html5 import NumberInput @@ -529,7 +529,7 @@ def make_contestant_table(query: Query, round: db.Round, add_checkbox: bool = Fa 'grade': pant.grade, 'born_year': pant.birth_year, 'region_code': cell_place_link(ct.place, ct.place.get_code()), - 'place_code': cell_place_link(pion.place, pion.place.get_code()), + 'place_code': cell_contest_place_link(ct, pion.place, pion.place.get_code()), 'status': pion.state.friendly_name(), 'checkbox': CellCheckbox('checked', u.user_id, False), }, diff --git a/mo/web/table.py b/mo/web/table.py index 72cbbcd14fdf0c7c501ccdb610dcbc6d52ec3543..a2f826056a54849a28ba680154ed63fa28c3f271 100644 --- a/mo/web/table.py +++ b/mo/web/table.py @@ -215,3 +215,7 @@ def cell_pion_link(user: db.User, contest_id: int, text: str) -> CellLink: def cell_place_link(place: db.Place, text: str) -> CellLink: return CellLink(text, url_for('org_place', id=place.place_id), hint=place.name) + + +def cell_contest_place_link(contest: db.Contest, place: db.Place, text: str) -> CellLink: + return CellLink(text, url_for('org_contest', ct_id=contest.contest_id, site_id=place.place_id), hint=place.name)