見積フォームの検証エラー時に入力済み明細が消失する #4

Closed
opened 2026-09-27 10:15:06 +00:00 by joe · 1 comment
Owner

現象

/estimates/new,/estimates/<id>/editのPOSTでバリデーションエラー時、items=[]/e.itemsを渡すため、入力済みの明細行(item_name[]/item_amount[])がすべて消える。

対象

app/routes/estimates.py

修正方針

エラー再表示時にrequest.form.getlistから明細行を再構築してテンプレートに渡す。

## 現象 `/estimates/new`,`/estimates/<id>/edit`のPOSTでバリデーションエラー時、`items=[]`/`e.items`を渡すため、入力済みの明細行(item_name[]/item_amount[])がすべて消える。 ## 対象 `app/routes/estimates.py` ## 修正方針 エラー再表示時に`request.form.getlist`から明細行を再構築してテンプレートに渡す。
Author
Owner

修正しました。バリデーションエラーでフォーム再表示する際、request.formから明細行を再構築して保持するようにしました(新規・編集とも)。テスト74件パス。

修正しました。バリデーションエラーでフォーム再表示する際、`request.form`から明細行を再構築して保持するようにしました(新規・編集とも)。テスト74件パス。
joe closed this issue 2026-09-27 11:00:31 +00:00
Sign in to join this conversation.
No labels
bug
cleanup
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joe/sougi#4
No description provided.