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

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

     
    266266        if self.exclude is None:
    267267            exclude = []
    268268        else:
    269             exclude = self.exclude
     269            exclude = list(self.exclude)
    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)
     
    780780        if self.exclude is None:
    781781            exclude = []
    782782        else:
    783             exclude = self.exclude
     783            exclude = list(self.exclude)
    784784        defaults = {
    785785            "form": self.form,
    786786            "formset": self.formset,
    787787            "fk_name": self.fk_name,
    788788            "fields": fields,
    789             "exclude": exclude + kwargs.get("exclude", []),
     789            "exclude": exclude + kwargs.pop("exclude", []),
    790790            "formfield_callback": self.formfield_for_dbfield,
    791791            "extra": self.extra,
    792792            "max_num": self.max_num,
Back to Top