06/04 Fix new Income transaction not be saved
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user