mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 09:52:36 +02:00
When double-clicking on the delete button, the first click actually deletes the bill, and the second click does the same action again. But as the bill is already deleted, it displays a 404 page which can be misleading. This fix makes the app trigger a redirect when the bill seem to doesn't exist, fixing this strange behaviour.
This commit is contained in:
parent
22f8d552c3
commit
24e0d8348f
1 changed files with 1 additions and 1 deletions
|
@ -514,7 +514,7 @@ def delete_bill(bill_id):
|
||||||
# fixme: everyone is able to delete a bill
|
# fixme: everyone is able to delete a bill
|
||||||
bill = Bill.query.get(g.project, bill_id)
|
bill = Bill.query.get(g.project, bill_id)
|
||||||
if not bill:
|
if not bill:
|
||||||
raise NotFound()
|
return redirect(url_for('.list_bills'))
|
||||||
|
|
||||||
db.session.delete(bill)
|
db.session.delete(bill)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
Loading…
Reference in a new issue