diff --git a/routes/admin.py b/routes/admin.py index 76ebf35..485c2d8 100644 --- a/routes/admin.py +++ b/routes/admin.py @@ -116,23 +116,15 @@ def admin_impersonate_team(tid): @admin_required def admin_toggle_eligibility(tid): team = Team.get(Team.id == tid) - team.eligible = not team.eligible + if team.eligibility is None: + team.eligibility = False + else: + team.eligibility = not team.eligibility team.save() flash("Eligibility set to {}".format(team.eligible)) return redirect(url_for(".admin_show_team", tid=tid)) -@admin.route("/team///toggle_eligibility_lock/") -@csrf_check -@admin_required -def admin_toggle_eligibility_lock(tid): - team = Team.get(Team.id == tid) - team.eligibility_locked = not team.eligibility_locked - team.save() - flash("Eligibility lock set to {}".format(team.eligibility_locked)) - return redirect(url_for(".admin_show_team", tid=tid)) - - @admin.route("/team//adjust_score/", methods=["POST"]) @admin_required def admin_score_adjust(tid): diff --git a/templates/admin/dashboard.html b/templates/admin/dashboard.html index e0cd1b6..35c8069 100644 --- a/templates/admin/dashboard.html +++ b/templates/admin/dashboard.html @@ -19,7 +19,7 @@ {{ team.name }} {{ team.affiliation }} - {{ "Eligible" if team.eligible else "Ineligible" }} + {{ "Eligible" if team.eligible() else "Ineligible" }} {{ lastsolvedata[team.id] }} {{ scoredata[team.id] }} diff --git a/templates/admin/team.html b/templates/admin/team.html index f75561b..2f64ef6 100644 --- a/templates/admin/team.html +++ b/templates/admin/team.html @@ -4,7 +4,6 @@ Impersonate team

This team is {{ "eligible" if team.eligible else "not eligible" }} (toggle). -Eligibility is {{ "locked" if team.eligibility_locked else "unlocked" }} (toggle).

This team's affiliation is {{ team.affiliation }}

Email