Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preference to allow reply speakers without substantives #1637

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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