hi.. i dont want my delete button to redirect to a success url,how  can i 
do that
this is my code:
class ChatMessageDeleteView(LoginRequiredMixin, generic.DeleteView, 
UserPassesTestMixin):
    model = ChatMessage
    # success_url = ''
    def test_func(self):
        message = self.get_object()
        if self.request.user == message.user:
            return True
        return False
    
     def get_success_url(self) -> str:
         msg = self.get_object()
         chat = msg.channel.id
         return reverse('chat:chat-channel', args=[chat])


*my button is working but its also sending DELETE method request to the 
success url also*
*im using htmx to send the delete request.*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f13638c1-f388-45a3-9eee-16b4f48ede0dn%40googlegroups.com.

Reply via email to