Yes, but that’s a different issue (I’ll get to that below).
The specific problem you’re asking about:
is caused by your form_invalid
method not returning an HttpResponse object. It has nothing to do with your form_valid
method. Making any changes, or doing anything to modify form_valid
is not going to resolve that issue, because form_valid
isn’t getting called.
Now, regarding your supplemental questions - the DeleteView is functionally different than the other editing views. The “form” being referenced in the view is not supposed to be an “edit” form. It’s intended to be a “confirmation form” - it should not have all the requirements of a model form.
You’re not even rendering that form in your template.
Review the docs and example at Generic editing views | Django documentation | Django