Code

Ticket #12901: 12901-against-12557.diff

File 12901-against-12557.diff, 615 bytes (added by ammarr, 4 years ago)
Line 
1Index: django/forms/models.py
2===================================================================
3--- django/forms/models.py      (revision 12557)
4+++ django/forms/models.py      (working copy)
5@@ -281,6 +281,9 @@
6             elif self._meta.fields and field not in self._meta.fields:
7                 exclude.append(f.name)
8 
9+            elif self._meta.exclude and field in self._meta.exclude:
10+                exclude.append(f.name)
11+
12             # Exclude fields that failed form validation. There's no need for
13             # the model fields to validate them as well.
14             elif field in self._errors.keys():