From 99a021b5af7887e5736a360e61d62fb31bdea785 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Tue, 1 May 2018 08:39:48 -0400 Subject: [PATCH] Fix error when *not* canceling a boost or fav --- brutaldon/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brutaldon/views.py b/brutaldon/views.py index f0af749..6ef35bc 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -204,7 +204,7 @@ def fav(request, id): mastodon = get_mastodon(request) toot = mastodon.status(id) if request.method == 'POST': - if not request.POST['cancel']: + if not request.POST.get('cancel', None): if toot.favourited: mastodon.status_unfavourite(id) else: @@ -217,7 +217,7 @@ def boost(request, id): mastodon = get_mastodon(request) toot = mastodon.status(id) if request.method == 'POST': - if not request.POST['cancel']: + if not request.POST.get('cancel', None): if toot.reblogged: mastodon.status_unreblog(id) else: