Skip to content

Commit

Permalink
Add a preference to allow reply speakers without substantives
Browse files Browse the repository at this point in the history
  • Loading branch information
franga2000 committed Oct 3, 2020
1 parent e0be3d0 commit 3ee5de5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tabbycat/options/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,15 @@ class ReplyScores(BooleanPreference):
default = True


@tournament_preferences_registry.register
class RequireSubstantiveForReply(BooleanPreference):
help_text = _("Whether to limit reply speeches to speakers who gave a constructive speech in the debate")
verbose_name = _("Require reply speaker to have given a substantive speech")
section = debate_rules
name = 'require_substantive_for_reply'
default = True


@tournament_preferences_registry.register
class MotionVetoes(BooleanPreference):
help_text = _("Enables the motion veto field on ballots, to track veto statistics")
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/results/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def clean_speakers(self, cleaned_data):
))

# The reply speaker must have given a substantive speech.
if len(speaker_positions.get(reply_speaker, [])) == 0:
if self.tournament.pref('require_substantive_for_reply') and len(speaker_positions.get(reply_speaker, [])) == 0:
self.add_error(self._fieldname_speaker(side, self.reply_position), forms.ValidationError(
_("The reply speaker for this team did not give a substantive speech."),
code='reply_speaker_not_repeat',
Expand Down

0 comments on commit 3ee5de5

Please sign in to comment.