#33263: DeleteView in Django4.0 does not call .delete() method
-------------------------------------+------------------------------------
     Reporter:  Eugene Prikazchikov  |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Generic views        |                  Version:  4.0
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------

Comment (by Eugene Prikazchikov):

 OK, that sounds good.

 As for:

 > a deprecation here stops us adopting the new behaviour.

 It is not quite true. In the patch that I linked in the ticket new
 behavior is preserved - DeleteView still inherits from `FormMixin` and
 `form_valid` is still executed. All checks passed - so behavior has not
 changed. To prevent existing Delete views overriding `delete` method from
 breaking, in this patch `form_valid()` calls `delete()`. If we want to add
 deprecation warning we could extend the patch. In `DeletionMixin.delete`
 we could emit a warning if HTTP method is  "POST".  Here:
 https://github.com/django/django/pull/15055/files#diff-
 bf5815bb9e60d6b9f1a261957863a70cc9ad03efdbd7941c0e1659b7ceb2895fR211

 {{{
 if request.method == "POST":
     # we arrived here from .form_valid(), let's emit warning
 }}}

 Anyway, if you believe that updating release notes is enough - I am fine
 with that.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33263#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.64cc873baa1b362d13d3c6a58ba07571%40djangoproject.com.

Reply via email to