香典返し更新で不正な送付日でも部分コミットされ、負の金額が保存できる #2
Loading…
Reference in a new issue
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?
レビュー指摘(deferred minor)の正式なissue化。
現象
POST /return-gifts/<id>/updateで:sent_dateのパース失敗時にflashエラーを出すが処理を続行し、他フィールドはcommitされて「更新しました。」も表示される(矛盾メッセージ)actual_amount/suggested_amountは_int_or_noneで非数値を無通知スキップするが、負値はそのまま保存される(クライアント側のmin=0のみでサーバ検証なし)対象
app/routes/return_gifts.pyupdate_gift修正方針
actual_amount/suggested_amountに>= 0チェックを追加修正しました。バリデーションエラー(不正な送付日・負の金額・非数値)は早期returnで一切commitせず、flashエラーのみ表示します。部分コミット・矛盾メッセージ・負額保存が解消。テスト72件パス。