Extracts ~350 lines of inline per-row computation from adults_view, juniors_view, and payments into three pure builder functions in scripts/views.py: build_adults_view_model, build_juniors_view_model, build_payments_view_model
Moves get_month_labels, group_payments_by_person, and adapt_junior_members out of app.py into views.py (view-model concerns, not Flask concerns)
Route handlers now contain only cache/IO calls + record_step timing + a single render_template call (~25 lines each vs 167/205/35 before)
No behaviour change — all 27 tests pass
Why
Prep for M5 of the Go rewrite: the /api/* shadow endpoints will be one-liners calling the same builders + jsonify(vm), with no logic duplication.
Test plan
make test — 27/27 green
Manual smoke: /adults, /juniors, /payments render identically to before
## Summary
- Extracts ~350 lines of inline per-row computation from `adults_view`, `juniors_view`, and `payments` into three pure builder functions in `scripts/views.py`: `build_adults_view_model`, `build_juniors_view_model`, `build_payments_view_model`
- Moves `get_month_labels`, `group_payments_by_person`, and `adapt_junior_members` out of `app.py` into `views.py` (view-model concerns, not Flask concerns)
- Route handlers now contain only cache/IO calls + `record_step` timing + a single `render_template` call (~25 lines each vs 167/205/35 before)
- No behaviour change — all 27 tests pass
## Why
Prep for M5 of the Go rewrite: the `/api/*` shadow endpoints will be one-liners calling the same builders + `jsonify(vm)`, with no logic duplication.
## Test plan
- [x] `make test` — 27/27 green
- [ ] Manual smoke: `/adults`, `/juniors`, `/payments` render identically to before
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pull 350+ lines of inline per-row computation out of adults_view,
juniors_view, and payments into three pure builder functions with no
Flask globals or IO dependencies. Route handlers now contain only
cache/IO calls and a single render_template. No behaviour change —
all 27 tests pass.
Also moves get_month_labels, group_payments_by_person, and
adapt_junior_members out of app.py. Prep for /api/* shadow endpoints
(M5 Go parity).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Accidentally removed when moving group_payments_by_person to views.py;
re.match in qr_code caused a 500 on every QR request.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr
merged commit 32a16ff50d into main2026-05-07 15:26:42 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
adults_view,juniors_view, andpaymentsinto three pure builder functions inscripts/views.py:build_adults_view_model,build_juniors_view_model,build_payments_view_modelget_month_labels,group_payments_by_person, andadapt_junior_membersout ofapp.pyintoviews.py(view-model concerns, not Flask concerns)record_steptiming + a singlerender_templatecall (~25 lines each vs 167/205/35 before)Why
Prep for M5 of the Go rewrite: the
/api/*shadow endpoints will be one-liners calling the same builders +jsonify(vm), with no logic duplication.Test plan
make test— 27/27 green/adults,/juniors,/paymentsrender identically to before🤖 Generated with Claude Code