-
-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit empty standings precedence and warn user accordingly (#1149)
* Make standings generation more robust #1108 This rewrites metricgetter() to avoid using Python's itemgetter(), so that the function it returns will always return a tuple. This simplifies a lot of handling, because it avoids the special case where itemgetter(item) called with one argument returns a single item rather than a tuple of length 1. As a consequence, the case where no metrics are specified now shouldn't crash. Also added standings test for this case. * Fix bug where extra metrics cause standings to crash Also added a unit test for this scenario * Add user alerts for blank standings precedence #1108
- Loading branch information
1 parent
bb28342
commit 82cd59e
Showing
13 changed files
with
175 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% extends "standings_table.html" %} | ||
{% load debate_tags i18n %} | ||
|
||
{# Note: This template is only used for admins (not public views of the tab). #} | ||
|
||
{% block page-alerts %} | ||
|
||
{% if pref.team_standings_precedence|length == 0 %} | ||
{% tournamenturl 'options-tournament-section' section='standings' as standings_config_url %} | ||
{% blocktrans trimmed asvar message %} | ||
The team standings precedence is empty. This means that teams aren't | ||
ranked according to any metrics, so everyone is first equal. If this isn't | ||
what you intended, set the team standings precedence in the | ||
<a href="{{ standings_config_url }}" class="alert-link">Standings section | ||
of this tournament's configuration</a>. In most | ||
tournaments, the first metric should be points or wins. | ||
{% endblocktrans %} | ||
{% include "components/alert.html" with type="warning" icon="alert-circle" %} | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.