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