From 8ab83275f62505860050282624a942645c050e91 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Wed, 5 Sep 2018 21:29:12 -0400 Subject: [PATCH] AJAX-ify the delete link on a toot --- brutaldon/templates/main/toot_partial.html | 7 ++++++- brutaldon/views.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html index 2ba4e7a..67853e4 100644 --- a/brutaldon/templates/main/toot_partial.html +++ b/brutaldon/templates/main/toot_partial.html @@ -124,7 +124,12 @@ redraft - + delete {% endif %} diff --git a/brutaldon/views.py b/brutaldon/views.py index 75e7504..c1e47c4 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -614,7 +614,7 @@ def boost(request, id): def delete(request, id): account, mastodon = get_usercontext(request) toot = mastodon.status(id) - if request.method == 'POST': + if request.method == 'POST' or request.method == 'DELETE': if toot.account.acct != request.session['user'].acct: return redirect('home') if not request.POST.get('cancel', None):