diff options
| author | Alexander Gaevsky <sasha@sasha0.ru> | 2016-01-09 22:15:21 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-21 13:22:02 -0500 |
| commit | be3169d6ed7e509c7e3c269e0cc5ae479cee9f9d (patch) | |
| tree | ecfec8c85c40d3a5af50c61e559f44073459fc0a /django | |
| parent | c9d1d5593b5533d970cc1d1fe918de72469920b5 (diff) | |
[1.9.x] Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.
Backport of 9a33d3d76497d9e198de942ee1236c452231262f from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/utils.py b/django/contrib/admin/utils.py index e85e2de0d3..254dd96f2c 100644 --- a/django/contrib/admin/utils.py +++ b/django/contrib/admin/utils.py @@ -383,7 +383,7 @@ def help_text_for_field(name, model): def display_for_field(value, field, empty_value_display): from django.contrib.admin.templatetags.admin_list import _boolean_icon - if field.flatchoices: + if getattr(field, 'flatchoices', None): return dict(field.flatchoices).get(value, empty_value_display) # NullBooleanField needs special-case null-handling, so it comes # before the general null test. |
