amfoss / amfoss/ammingo-backend
Tiles can't be marked, it always shows an error "Friend has already been submitted"
- 主要言語
- Python
- スター
- 2
- フォーク
- 4
- 平均マージ
- 1分
- マージ済み PR(30日)
- 5
説明
### Problem
Submitting any tile in a game always fails with "Friend has already been submitted", even on fresh, never-used tiles. Tiles never get marked and points never accumulate.
### Steps to reproduce
1. Create a game (user A), join with a second account (user B), start the game
2. Open any tile and add a photo
3. Enter friend B's exact name and code, tap "VERIFY AND MARK TILE"
4. The "Friend has already been submitted" error always appears, whatever the tile
### Root cause
In `app/routes/game.py`, `friend_already_submitted` holds a SQLAlchemy `Query` object rather than the query result. A `Query` object is always truthy, so that check raises every time before the tile is saved. `tile.friend_id` is also never set, so the duplicate-friend check wouldn't catch anything regardless.
### Expected behaviour
- First submission marks the tile and updates points
- Reusing the same friend is rejected
- Submitting the same tile twice is rejected
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。