diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-12-03 16:41:46 +0100 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-12-03 16:41:46 +0100 |
| commit | b1665770e844e930a7dd4c11598c2a8e66aa0909 (patch) | |
| tree | 4afec45bce3646c91c470e5a884de3d8bd44b90a | |
| parent | 79cbd72c03326080c69e6b708203ed65a68dff16 (diff) | |
| download | ihatemoney-mirror-b1665770e844e930a7dd4c11598c2a8e66aa0909.zip ihatemoney-mirror-b1665770e844e930a7dd4c11598c2a8e66aa0909.tar.gz ihatemoney-mirror-b1665770e844e930a7dd4c11598c2a8e66aa0909.tar.bz2 | |
The 'submit and add a new one' button now acts as intended
| -rw-r--r-- | budget/web.py | 9 |
1 files changed, 7 insertions, 2 deletions
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("/<project_id>/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) |
