Ticket #8999: modeladmin-getform-and-getformset-exclude-fix.diff

File modeladmin-getform-and-getformset-exclude-fix.diff, 928 bytes (added by Sean Legassick, 16 years ago)
  • django/contrib/admin/options.py

     
    270270        defaults = {
    271271            "form": self.form,
    272272            "fields": fields,
    273             "exclude": exclude + kwargs.get("exclude", []),
     273            "exclude": exclude + kwargs.pop("exclude", []),
    274274            "formfield_callback": self.formfield_for_dbfield,
    275275        }
    276276        defaults.update(kwargs)
     
    795795            "formset": self.formset,
    796796            "fk_name": self.fk_name,
    797797            "fields": fields,
    798             "exclude": exclude + kwargs.get("exclude", []),
     798            "exclude": exclude + kwargs.pop("exclude", []),
    799799            "formfield_callback": self.formfield_for_dbfield,
    800800            "extra": self.extra,
    801801            "max_num": self.max_num,
Back to Top