From 1fc33ca60f10717f7c8c79d252feacbff69e96cc Mon Sep 17 00:00:00 2001 From: NguyenND Date: Thu, 4 Jun 2026 11:13:05 -0400 Subject: [PATCH] 06/04 Fix new Income transaction not be saved --- app/routes/transactions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/routes/transactions.py b/app/routes/transactions.py index 4ac1f5f..480213c 100644 --- a/app/routes/transactions.py +++ b/app/routes/transactions.py @@ -131,8 +131,9 @@ def new(): txn_type = 'expense' form = TransactionForm() - # On POST, honour the type the user selected in the toggle - if request.method == 'POST': + if request.method == 'GET': + form.transaction_type.data = txn_type + elif request.method == 'POST': submitted = request.form.get('transaction_type', txn_type) if submitted in ('income', 'expense'): txn_type = submitted