2👍
✅
My question seems to be a duplicate of Example of Django Class-Based DeleteView
This is how to do it:
def get_object(self, queryset=None):
""" Hook to ensure object is owned by request.user. """
obj = super(MyDeleteView, self).get_object()
if not obj.owner == self.request.user:
raise Http404
return obj
Source:stackexchange.com