#35531: BaseModelFormSet.clean() recursively triggers is_valid() which may cause
problems when is_valid() was overriden
----------------------------------+--------------------------------------
     Reporter:  Christophe Henry  |                    Owner:  Rish
         Type:  Bug               |                   Status:  closed
    Component:  Forms             |                  Version:  dev
     Severity:  Normal            |               Resolution:  invalid
     Keywords:                    |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  1                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Changes (by Natalia Bidart):

 * resolution:   => invalid
 * status:  assigned => closed

Comment:

 Hello Christophe Henry! Thank you for taking the time to create this
 ticket.

 I think I understand your explanation but, from my point of view, the
 method `is_valid()` should not be changed and instead, custom validation
 logic should be done in `clean()` or similar methods. If your app
 absolutely needs to override `is_valid()`, it should do so in a way that
 the method remains idempotent. Django provides no guarantees that
 `is_valid()` is going to be called only once, so your app should not
 depend on that.

 Given the above, I'll close the ticket accordingly, but if you disagree,
 you can consider starting a new conversation on the
 [https://forum.djangoproject.com/c/internals/5 Django Forum], where you'll
 reach a wider audience and likely get extra feedback. If you do so, please
 make sure to provide a complete and correct example, because the code
 provided in the description is incomplete and can not be used to reproduce
 the issue you are describing.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35531#comment:2>
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/010701903c3dbbe9-d531ac10-8e34-41d9-8ff2-df6c6674d9e5-000000%40eu-central-1.amazonses.com.

Reply via email to