feat: add parent waiver/release to registration flow #28
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/26-parent-waiver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a legally binding waiver/release to the player registration form. Parents must read and accept the waiver before submitting. Signature, timestamp, and IP address are recorded on the Parent model. Same pattern as the coach contractor agreement.
Changes
alembic/versions/005_add_parent_waiver_fields.py: new migration addingwaiver_signed,waiver_signed_at,waiver_signed_iptoparentstablesrc/basketball_api/models.py: three new columns onParentmodelsrc/basketball_api/routes/register.py: waiver text constant, waiver section in form HTML (both token and walk-up paths), server-side validation rejecting POST withoutwaiver=yes, recording waiver fields on parent, showing "Waiver signed" on confirmation pagesrc/basketball_api/brand.py: added.agreement,.checkbox-row, and.submit-btn:disabledCSS classes toBRAND_CSStests/test_register.py: addedwaiver: "yes"to all existing POST tests, added 6 new waiver-specific testsTest Plan
test_register.pypass (26 existing + 6 new)Review Checklist
Related
plan-2026-03-08-tryout-prep-- tryout management MVPSelf-review complete. No issues found.
waiver: "yes", 6 new waiver tests addedPR #28 Review
Title: feat: add parent waiver/release to registration flow
Branch:
fix/26-parent-waiver->mainFiles changed: 5 (+290, -2)
BLOCKERS
None.
NITS
Duplicate test coverage:
test_token_form_shows_waiverinTestRegistrationTokenPreFillandtest_get_register_token_shows_waiverinTestWaivertest the same thing (GET /register?token=X shows waiver). Not harmful, but one could be removed to reduce test maintenance. Non-blocking.CSS duplication: The
.agreement,.checkbox-row, and.submit-btn:disabledrules added toBRAND_CSSare near-duplicates of what already exists inCOACH_CSS. A future refactor could extract shared agreement/checkbox CSS into a common block. Non-blocking.CODE REVIEW
Migration (005): Clean. Three columns added to
parentstable:waiver_signed(Boolean, NOT NULL, default false),waiver_signed_at(DateTime, nullable),waiver_signed_ip(String(45), nullable). Safe for existing data. Downgrade reverses correctly. Revision chain 004 -> 005 is correct.Model: Three new
Mappedcolumns onParentmatch the migration exactly.String(45)for IP correctly handles both IPv4 and IPv6.Waiver text: All 6 required sections present -- Assumption of Risk, Liability Release, Medical Authorization, Photo/Video Release, Code of Conduct, Digital Acceptance. Content is legally reasonable.
Client-side validation: Submit button starts
disabled, checkboxonchangetoggles it. HTMLrequiredattribute on checkbox provides additional browser-level enforcement.Server-side validation:
if waiver != "yes"returns 400 with error message. Placed after all other field validations in the correct order (player_name -> parent_name -> parent_email -> graduating_class -> waiver).Waiver recording: Uses
datetime.now(timezone.utc)(not naive datetime). IP captured viarequest.client.hostwith "unknown" fallback. Fields set unconditionally on every successful submit (re-registrations overwrite, which is correct behavior).Both paths covered:
_render_form()is shared by token pre-fill and walk-up flows, so waiver appears in both. Tests confirm this for both paths.Confirmation page: Shows "Waiver signed" with formatted UTC timestamp.
Tests: All 10 existing POST tests in
TestRegistrationFormPostupdated with"waiver": "yes". The 3 validation error tests (missing player_name, missing parent_email, missing graduating_class) correctly omit waiver since they fail validation before reaching the waiver check. 7 new waiver-specific tests cover: rejection without waiver, acceptance with waiver, walk-up form shows waiver, token form shows waiver, confirmation shows waiver signed, rejection with waiver=no, plus a duplicate in the token pre-fill class.Security: No secrets, .env files, or credentials. IP logging is appropriate for legal audit. No XSS vectors (waiver text is a static constant, not user input).
SOP COMPLIANCE
fix/26-parent-waiverreferences #26)plan-2026-03-08-tryout-prep)VERDICT: APPROVED