diff options
| author | tschilling <schillingt@better-simple.com> | 2013-09-25 17:00:51 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-02 08:16:09 -0400 |
| commit | 5381317fe37d50384ef9a3bf3fb6b64ff4e9215c (patch) | |
| tree | 80becfacb06f13dbd88cabed9bfdaa2e23954c15 /django | |
| parent | 651bed09182cc7f2fadc54026924fd5815fc47f1 (diff) | |
Fixed #21129 -- Prevented admin filter params modifications from throwing an exception.
Thanks Tuttle for the report.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/options.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 521b2371a6..3b570c1a5f 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -348,6 +348,10 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)): # later. return True if hasattr(field, 'rel'): + if field.rel is None: + # This property or relation doesn't exist, but it's allowed + # since it's ignored in ChangeList.get_filters(). + return True model = field.rel.to rel_name = field.rel.get_related_field().name elif isinstance(field, RelatedObject): |
