Skip to content

feat(tournaments): remove members who decline age disclosure - #122

Merged
ethnjs merged 6 commits into
mainfrom
feat/age-decline-removes-membership
Oct 20, 2026
Merged

ethnjs merged 6 commits into
mainfrom
feat/age-decline-removes-membership

Conversation

@ethnjs

@ethnjs ethnjs commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  1. Declining a tournament's age-disclosure prompt now removes the member from the tournament, instead of keeping a hidden "declined" membership that still showed up in places like the join page's "Continue onboarding" card.
  2. The tournament owner is no longer shown the age-disclosure prompt; every other member, including staff with permissions, still is.
  3. Memberships already marked declined are reset to unanswered, so those members are asked again.

What changed

Backend

Models and migrations

alembic upgrade head required — 1 revision.

  • Clears age_disclosure and age_disclosure_at on every tournament_memberships row where age_disclosure = 'declined'; no schema change. (fd68532fea68)
  • TournamentMembership.age_disclosure is now only NULL (unanswered) or "consented".

Schemas and routes

  • POST /tournaments/{id}/members/me/age-disclosure/ with consent: false deletes the caller's membership and their responses to the tournament's forms, then returns the no-membership MembershipMeResponse (id: null).
  • The same route returns 400 when the owner tries to decline.
  • GET /tournaments/{id}/members/me/ returns needs_age_consent: false for the owner.
  • Removes the include_declined query parameter from GET /tournaments/{id}/members/.
  • MembershipFullResponse.age_disclosure no longer returns "declined".

Logic

  • Removes ACTIVE_MEMBERSHIP_CLAUSE and is_declined() from core/tournament/memberships.py; has_any_membership() is now a plain existence check.
  • Drops the declined filter from GET /tournaments/me/, tournament_counts() volunteer counts, with_member_counts() role counts, build_member_summary(), recompute_onboarding(), ownership transfer, GET /tournaments/{id}/forms/me/ and POST /tournaments/{id}/onboarding/progress/.
  • _no_membership_response() builds the id: null response shared by GET .../members/me/ and a decline.

Frontend

  • AgeDisclosureModal: the prompt now says declining removes you, deletes your form responses and needs a new join link to come back.
  • AgeDisclosureModal: Decline opens a danger modal ("Leave this tournament?") before anything is sent.
  • lib/api.ts: removes includeDeclined from membersApi.list and narrows age_disclosure to "consented" | null.

Out of scope

  • No audit log entry is written when a member declines.

Test plan

  • pytest passes locally
  • Migration included for every model change
  • Clicked through the UI change in a browser

Automated

  • tests/api/tournament/test_memberships.py: decline deletes the membership, its lunch rows and form responses, and drops the tournament from GET /tournaments/me/; the owner can't decline; the owner isn't prompted; a member with permissions is.
  • Tests for the declined state are removed from test_memberships.py, test_core.py, test_admin.py, test_roles.py and test_member_summary.py.

Manual

  • As a member of a tournament that collects an age flag: Decline → "Decline and leave" lands on the dashboard without that tournament, and its join link offers to join again.
  • Cancel in the danger modal goes back to the prompt without declining.
  • As the owner of that tournament: no age-disclosure prompt.

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nexus Ready Ready Preview Oct 16, 2026 7:14am UTC

@railway-app
railway-app Bot temporarily deployed to nexus / nexus-pr-122 October 16, 2026 06:35 Destroyed
@railway-app

railway-app Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the nexus-pr-122 environment in nexus

Service Status Web Updated
nexus ✅ Success (View Logs) Oct 16, 2026 at 7:15 am UTC

@railway-app
railway-app Bot temporarily deployed to nexus / nexus-pr-122 October 16, 2026 07:13 Destroyed
@ethnjs
ethnjs merged commit 2fc1642 into main Oct 20, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7ac8b55f Deployed Oct 16, 2026 by vercel[bot]
nexus / nexus-pr-122 — 7ac8b55f Deployed Oct 16, 2026 by railway-app[bot]
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.

1 participant