Ticket #8999: modeladmin-getform-and-getformset-exclude-fix-2.diff
File modeladmin-getform-and-getformset-exclude-fix-2.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
266 266 if self.exclude is None: 267 267 exclude = [] 268 268 else: 269 exclude = self.exclude269 exclude = list(self.exclude) 270 270 defaults = { 271 271 "form": self.form, 272 272 "fields": fields, 273 "exclude": exclude + kwargs. get("exclude", []),273 "exclude": exclude + kwargs.pop("exclude", []), 274 274 "formfield_callback": self.formfield_for_dbfield, 275 275 } 276 276 defaults.update(kwargs) … … 780 780 if self.exclude is None: 781 781 exclude = [] 782 782 else: 783 exclude = self.exclude783 exclude = list(self.exclude) 784 784 defaults = { 785 785 "form": self.form, 786 786 "formset": self.formset, 787 787 "fk_name": self.fk_name, 788 788 "fields": fields, 789 "exclude": exclude + kwargs. get("exclude", []),789 "exclude": exclude + kwargs.pop("exclude", []), 790 790 "formfield_callback": self.formfield_for_dbfield, 791 791 "extra": self.extra, 792 792 "max_num": self.max_num,