Commit dd0e5fd9 authored by Brian Rosner's avatar Brian Rosner
Browse files

Fixed #8324 -- Corrected the simple case where list_display is not given....

Fixed #8324 -- Corrected the simple case where list_display is not given. Thanks tobias for the quick report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent b2ec6473
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ def result_headers(cl):
    lookup_opts = cl.lookup_opts
    
    for i, field_name in enumerate(cl.list_display):
        attr = None
        try:
            f = lookup_opts.get_field(field_name)
            admin_order_field = None
@@ -150,7 +151,8 @@ def items_for_result(cl, result):
                if callable(field_name):
                    attr = field_name
                    value = attr(result)
                elif hasattr(cl.model_admin, field_name):
                elif hasattr(cl.model_admin, field_name) and \
                   not field_name == '__str__' and not field_name == '__unicode__':
                    attr = getattr(cl.model_admin, field_name)
                    value = attr(result)
                else: