1.6 KiB
1.6 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| c9b2c04d-258a-4028-849b-a47f6168a6ab | workflow | PR review: paper-dynasty-database#52 — consolidate double-query in get_one_play |
|
0.4 | 0.8 | 2026-03-04T03:18:19.838537+00:00 | 2026-03-04T03:18:20.339054+00:00 |
|
PR #52 — fix: consolidate redundant double-query in get_one_play
Verdict: APPROVED (posted as COMMENT due to Gitea self-review restriction)
File: app/routers_v2/stratplays.py
Change Summary
get_one_play was calling get_or_none (discarding the result) then get_by_id to fetch the same record again. Fix stores the get_or_none result and passes it directly to model_to_dict, eliminating the redundant second query.
Key Findings
- Correct:
get_or_nonereturns the model instance or None — reusing it is semantically identical - No security issues — unauthenticated GET, int-typed param
- Clean, minimal change following project conventions
Follow-up Note
patch_play at ~line 1412 has the same double-query pattern and should be fixed in a follow-up issue.