見積フォームの検証エラー時に入力済み明細が消失する #4
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?
現象
/estimates/new,/estimates/<id>/editのPOSTでバリデーションエラー時、items=[]/e.itemsを渡すため、入力済みの明細行(item_name[]/item_amount[])がすべて消える。対象
app/routes/estimates.py修正方針
エラー再表示時に
request.form.getlistから明細行を再構築してテンプレートに渡す。修正しました。バリデーションエラーでフォーム再表示する際、
request.formから明細行を再構築して保持するようにしました(新規・編集とも)。テスト74件パス。