06/04 Fix new Income transaction not be saved

This commit is contained in:
2026-06-04 11:13:05 -04:00
parent 2b8f2bbdd1
commit 1fc33ca60f
+3 -2
View File
@@ -131,8 +131,9 @@ def new():
txn_type = 'expense' txn_type = 'expense'
form = TransactionForm() form = TransactionForm()
# On POST, honour the type the user selected in the toggle if request.method == 'GET':
if request.method == 'POST': form.transaction_type.data = txn_type
elif request.method == 'POST':
submitted = request.form.get('transaction_type', txn_type) submitted = request.form.get('transaction_type', txn_type)
if submitted in ('income', 'expense'): if submitted in ('income', 'expense'):
txn_type = submitted txn_type = submitted