mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.
This commit is contained in:
committed by
Tim Graham
parent
fb4272f0e6
commit
9a33d3d764
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user