diff --git a/budget/web.py b/budget/web.py index 5b10460..2a3715e 100644 --- a/budget/web.py +++ b/budget/web.py @@ -249,7 +249,7 @@ def list_bills(): return render_template("list_bills.html", bills=bills, member_form=MemberForm(g.project), bill_form=bill_form, - add_bill='add_bill' in request.values + add_bill=request.values.get('add_bill', False) ) @main.route("//members/add", methods=["GET", "POST"]) @@ -300,7 +300,12 @@ def add_bill(): db.session.commit() flash(_("The bill has been added")) - return redirect(url_for('.list_bills', add_bill=form.submit2.data)) + + args = {} + if form.submit2.data: + args['add_bill'] = True + + return redirect(url_for('.list_bills', **args)) return render_template("add_bill.html", form=form)