49 lines
2.0 KiB
Markdown
49 lines
2.0 KiB
Markdown
---
|
|
id: 9dc591ce-c353-4998-889a-40770f77946c
|
|
type: workflow
|
|
title: "PR review: major-domo-database#40 — raise HTTPException in recalculate_standings"
|
|
tags: [pr-reviewer, major-domo-database, fastapi, python, peewee, standings, bug-fix]
|
|
importance: 0.4
|
|
confidence: 0.8
|
|
created: "2026-03-03T01:11:07.751846+00:00"
|
|
updated: "2026-03-03T01:11:08.100798+00:00"
|
|
relations:
|
|
- target: a64fd0a1-cf42-469a-9280-991ab85bbfb2
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.62
|
|
edge_id: 87e3335c-2e15-477d-9107-da7de9a43fad
|
|
- target: bb05e13c-d0dd-422e-a7b2-d5eaa891f0b3
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.6
|
|
edge_id: b878120c-e39a-420f-be4c-4a0ee7af836c
|
|
- target: 01be6857-1bf1-4000-a2b5-29e05053e8e7
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.58
|
|
edge_id: e1c03472-7713-4229-9452-7283c0cd2511
|
|
---
|
|
|
|
## PR Review: major-domo-database#40
|
|
|
|
**Verdict**: APPROVED (posted as COMMENT — Gitea blocks self-approval)
|
|
|
|
**Branch**: `ai/major-domo-database-23` → `main`
|
|
|
|
### Key Findings
|
|
|
|
1. **Primary fix correct** (`standings.py`): Missing `raise` before `HTTPException` in `recalculate_standings`. Without it, error code 69 from `Standings.recalculate()` was silently swallowed and HTTP 200 returned. One-word fix, unambiguous.
|
|
|
|
2. **Undocumented secondary fix** (`stratgame.py`): In `get_games()`, both `order_by()` calls were not assigned back to `all_games`. Peewee's `order_by()` returns a new query (immutable pattern) — so sorting was silently ignored. The PR correctly fixes this with `all_games = all_games.order_by(...)` but the PR description only mentions `standings.py`.
|
|
|
|
3. **Extensive reformatting** in both files: single → double quotes, line wrapping. Cosmetic but consistent.
|
|
|
|
### Patterns Noted
|
|
- Peewee ORM: `order_by()` does NOT mutate — must assign result back
|
|
- FastAPI: `HTTPException` must be `raise`d — constructing without raising is a silent no-op (Python doesn't warn on this)
|
|
|
|
### Files Reviewed
|
|
- `app/routers_v3/standings.py`
|
|
- `app/routers_v3/stratgame.py`
|