aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2018-09-03 20:53:37 +0200
committerGitHub <noreply@github.com>2018-09-03 20:53:37 +0200
commit24e0d8348fb5855d0255b41ec1ca9beaf233d9a6 (patch)
tree902f81e3028c698348102ce86d8861d728d08671 /ihatemoney
parent22f8d552c3f2273f1ea1cfa81cb10fe8f3cad21d (diff)
downloadihatemoney-mirror-24e0d8348fb5855d0255b41ec1ca9beaf233d9a6.zip
ihatemoney-mirror-24e0d8348fb5855d0255b41ec1ca9beaf233d9a6.tar.gz
ihatemoney-mirror-24e0d8348fb5855d0255b41ec1ca9beaf233d9a6.tar.bz2
Fix double-click when deleting a bill (#349) (#372)
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.
Diffstat (limited to 'ihatemoney')
-rw-r--r--ihatemoney/web.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ihatemoney/web.py b/ihatemoney/web.py
index b462fe4..f6f04af 100644
--- a/ihatemoney/web.py
+++ b/ihatemoney/web.py
@@ -514,7 +514,7 @@ def delete_bill(bill_id):
# fixme: everyone is able to delete a bill
bill = Bill.query.get(g.project, bill_id)
if not bill:
- raise NotFound()
+ return redirect(url_for('.list_bills'))
db.session.delete(bill)
db.session.commit()