@login_required
def destroy(request, id):
    post = Post.objects.get(pk=id)
    user = request.user
    title = post.title
    if post.author != request.user:
        messages.add_message(request, messages.ERROR,
            ugettext("You can't delete posts that aren't yours")
        )
        return HttpResponseRedirect(reverse("blog_list_yours"))
    
    if request.method == "POST" and request.POST["action"] == "delete":
        post.delete()
        messages.add_message(request, messages.SUCCESS,
            title % ugettext("Successfully deleted post '%s'")
        )
        return HttpResponseRedirect(reverse("blog_list_yours"))
    else:
        return HttpResponseRedirect(reverse("blog_list_yours"))
    
    return render_to_response(context_instance=RequestContext(request))
dataset/ETHPy150Open amarandon/smeuhsocial/apps/blog/views.py/destroy/swapped operands of `%`