diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-08 12:41:11 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-12-08 12:41:11 +0100 |
| commit | 04e6542b5a904762a4e723c9b04ba5650ee9dc2e (patch) | |
| tree | f2862e206b79ffa982600414e6bfc0587999d1c1 /django | |
| parent | 6140795150b3811d5969315c02556861575e87eb (diff) | |
Fixed #19423 -- Prevented ModelAdmin sharing widgets due to formfield_overrides
Thanks joebuyer at manycycles.com for the report and Simon Charette
for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/options.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index c48ffa6ca3..f4c27511d3 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -1,3 +1,4 @@ +import copy from functools import update_wrapper, partial import warnings @@ -130,7 +131,7 @@ class BaseModelAdmin(six.with_metaclass(forms.MediaDefiningClass)): # passed to formfield_for_dbfield override the defaults. for klass in db_field.__class__.mro(): if klass in self.formfield_overrides: - kwargs = dict(self.formfield_overrides[klass], **kwargs) + kwargs = dict(copy.deepcopy(self.formfield_overrides[klass]), **kwargs) return db_field.formfield(**kwargs) # For any other type of field, just call its formfield() method. |
