Skip to content

Add per-debater opt-out from public speaker rankings#512

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/create-per-debater-opt-outs
Draft

Add per-debater opt-out from public speaker rankings#512
Copilot wants to merge 4 commits intomasterfrom
copilot/create-per-debater-opt-outs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Mirrors the existing per-team ranking_public opt-out mechanism for individual debaters on the public speaker rankings page.

Changes

  • Debater model — adds ranking_public = models.BooleanField(default=True), matching the same field on Team
  • Migration0037_debater_ranking_public.py
  • public_speaker_rankings view — filters both varsity and novice speaker lists to exclude debaters with ranking_public=False before building the public table. Varsity speaker rankings include all speakers (both varsity and novice); novice speaker rankings include only novices.
  • DebaterForm — picks up the new field automatically since it already excludes only tiebreaker

Tests

Added unit tests in mittab/libs/tests/views/test_public_views.py covering:

  • A debater with ranking_public=False is excluded from varsity speaker rankings
  • A novice debater with ranking_public=False is excluded from both sections
  • A novice debater with ranking_public=True appears in both the varsity and novice sections
  • A varsity debater does not appear in the novice section

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Agent-Logs-Url: https://github.com/MIT-Tab/mit-tab/sessions/de32131d-77c9-468b-a8b0-88463dc91021

Co-authored-by: JoeyRubas <46765074+JoeyRubas@users.noreply.github.com>
Copilot AI changed the title [WIP] Add per-debater opt outs for public speaker rankings page Add per-debater opt-out from public speaker rankings Mar 27, 2026
Copilot AI requested a review from JoeyRubas March 27, 2026 18:25
@JoeyRubas
Copy link
Copy Markdown
Member

@copilot varsity speaker rankings should include varsity or novice, novice speaker rankings should be just novices

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot varsity speaker rankings should include varsity or novice, novice speaker rankings should be just novices

Fixed in 03e96ee — the varsity section now shows all speakers (both varsity and novice), while the novice section remains novice-only. The ranking_public opt-out applies to both.

@JoeyRubas
Copy link
Copy Markdown
Member

@copilot add unit tests

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.68%. Comparing base (8c5d252) to head (03e96ee).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #512      +/-   ##
==========================================
- Coverage   78.72%   78.68%   -0.05%     
==========================================
  Files         122      123       +1     
  Lines        9316     9321       +5     
==========================================
  Hits         7334     7334              
- Misses       1982     1987       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot add unit tests

Added 4 unit tests in eb72f2d covering:

  • test_debater_ranking_public_false_excluded_from_varsity_speakers — confirms a debater appears first, then verifies they're hidden after setting ranking_public=False
  • test_novice_debater_ranking_public_false_excluded_from_novice_speakers — same pattern for novice debaters, hidden from both sections
  • test_novice_debater_ranking_public_true_appears_in_varsity_and_novice — verifies a novice debater's name appears in both the varsity and novice HTML sections separately
  • test_varsity_debater_does_not_appear_in_novice_speakers — asserts the novice section exists, then verifies a varsity debater is absent from it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants