Ticket #12901: 12901.diff

File 12901.diff, 664 bytes (added by Chris Beaven, 10 years ago)
  • django/forms/models.py

    diff --git a/django/forms/models.py b/django/forms/models.py
    index 0039516..f440cf6 100644
    a b class BaseModelForm(BaseForm): 
    274274            field = f.name
    275275            # Exclude fields that aren't on the form. The developer may be
    276276            # adding these values to the model after form validation.
    277             if field not in self.fields:
     277            if self._meta.fields and field not in self._meta.fields:
    278278                exclude.append(f.name)
    279279            # Exclude fields that failed form validation. There's no need for
    280280            # the model fields to validate them as well.
Back to Top