Hi,

Yesterday I found that calling self.errors in the constructor of a Form
that is in an InlineFormSet (or any formset I guess): the "delete" of a
form doesn't work anymore. I wonder if this is a bug in Django (for this
case, if a new bug is needed, I'm happy to open it... or be referred to
an existing bug) or if I missed some bit of the documentation.

Summary:
BaseForm.errors does:
https://github.com/django/django/blob/master/django/forms/forms.py#L169

The DELETE field in self.fields is added in the form.fields via BaseFormSet 
after calling the constructor of the form:
https://github.com/django/django/blob/master/django/forms/formsets.py#L175

So calling self.errors cleans the data but DELETE doesn't end up in
self.clean_fields (because it's not in self.fields). When DELETE is
added as a field self.clean_fields is not updated.

(I'm talking about this:
https://github.com/django/django/blob/master/django/forms/formsets.py#L390
being executed too late; or self.errors being called too early)

The full story is here:
https://groups.google.com/forum/#!topic/django-users/wO9H0cNcLfI

Thank you very much,

-- 
Carles Pina i Estany
https://carles.pina.cat

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20200619104406.GA26082%40pina.cat.

Reply via email to