mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
The 'submit and add a new one' button now acts as intended
This commit is contained in:
parent
79cbd72c03
commit
b1665770e8
1 changed files with 7 additions and 2 deletions
|
@ -249,7 +249,7 @@ def list_bills():
|
||||||
return render_template("list_bills.html",
|
return render_template("list_bills.html",
|
||||||
bills=bills, member_form=MemberForm(g.project),
|
bills=bills, member_form=MemberForm(g.project),
|
||||||
bill_form=bill_form,
|
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"])
|
@main.route("/<project_id>/members/add", methods=["GET", "POST"])
|
||||||
|
@ -300,7 +300,12 @@ def add_bill():
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(_("The bill has been added"))
|
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)
|
return render_template("add_bill.html", form=form)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue