title: Comment isn't getting deleted
body: <p>I made a comment model for a blog and I wanted to give the user a way to delete the comment so I made a function based view for it but it didn't work so I decided to use a class based view but both of the views give the same error. the only thing that happens is that the url gets a <code>?</code> after it and the page just refreshes as it is. The function based and class based views are both given below</p>
  
  <p>func based</p>
  
  <pre><code>def comment_delete(request, pk):
      comment_to_delete=get_object_or_404(comment,pk=pk)
      if request.method=='POST':
          post_url=comment_to_delete.content_object.get_absolute_url()
          comment_to_delete.delete()
          messages.success(request, 'Your comment has been deleted')
          return HttpResponseRedirect(post_url)
  
      context={
          'comment':comment_to_delete
      }
      return render(request, 'blog/confirm_delete.html', context)
  </code></pre>
  
  <p>class based</p>
  
  <pre><code>class DeleteView(LoginRequiredMixin, UserPassesTestMixin, DeleteView):
      model = comment
      success_url = '/'
  
      def test_func(self):
          comment= self.get_object()
          if self.request.user == comment.user:
              return True
          return False
  </code></pre>
  
  <p>html of confirm page</p>
  
  <pre><code>{% extends 'blog/base.html' %}
  {% block content %}
  
  
  
  &lt;form&gt;
      &lt;p&gt;are you sure you want to delete {{ comment }}&lt;/p&gt;
      &lt;input type="submit" value="confirm" &gt;
  
  &lt;/form&gt;
  
  
  {% endblock %}
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class comment(models.Model):
      post=models.ForeignKey(Blog, on_delete=models.CASCADE)
      user=models.ForeignKey(User, on_delete=models.CASCADE)
      content=models.TextField(max_length=160)
      timestamp=models.DateTimeField(auto_now_add=True)
  
      def __str__(self):
          return '{}-{}'.format(self.post.title,str(self.user.username))
  
      def get_absolute_url(self):
          return reverse('comment', kwargs={"pk": self.pk})
  </code></pre>