Fix ignored order_by() call in stratgame.py
#24
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#24
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
app/routers_v3/stratgame.py:94-97— Peewee'sorder_by()returns a new queryset; it does not sort in place. Both branches discard the return value. Games are never sorted inGET /api/v3/gamesregardless of thesortparameter.Priority: high | Labels: bug
Fixed in PR #39.
Root cause:
order_by()in Peewee returns a new queryset — it does not mutate in place. Both branches were callingall_games.order_by(...)without assigning the result back, so the ORDER BY clause was silently discarded and games were always returned in insertion order.Fix: changed both branches to
all_games = all_games.order_by(...)inapp/routers_v3/stratgame.py.