diff options
| author | Honza Kral <honza.kral@gmail.com> | 2013-02-23 23:20:34 +0100 |
|---|---|---|
| committer | Honza Kral <honza.kral@gmail.com> | 2013-02-23 23:20:34 +0100 |
| commit | 2b48fcc607010065c0f8107baf669dd41b164f3c (patch) | |
| tree | 53def9faa63ebddc44c1d5091b0aa6f939668512 /django | |
| parent | 83ecb7b145644a1489db4137ac4d779bf1f294ca (diff) | |
Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/util.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/admin/util.py b/django/contrib/admin/util.py index 133a8ad13e..97858e688e 100644 --- a/django/contrib/admin/util.py +++ b/django/contrib/admin/util.py @@ -154,6 +154,9 @@ class NestedObjects(Collector): if source_attr: self.add_edge(getattr(obj, source_attr), obj) else: + if obj._meta.proxy: + # Take concrete model's instance to avoid mismatch in edges + obj = obj._meta.concrete_model(pk=obj.pk) self.add_edge(None, obj) try: return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs) |
