From 855d9909c6afa94cafb128c0cf9ffd7a06339e77 Mon Sep 17 00:00:00 2001 From: Robert Wittams Date: Wed, 23 Nov 2005 16:18:17 +0000 Subject: [PATCH] Exception handling fix for change lists. Cheers plisk. git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1367 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/admin_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index fe1c56034b..ccaaa88be1 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/django/contrib/admin/templatetags/admin_list.py @@ -115,10 +115,10 @@ def items_for_result(cl, result): except meta.FieldDoesNotExist: # For non-field list_display values, the value is a method # name. Execute the method. - func = getattr(result, field_name) try: + func = getattr(result, field_name) result_repr = str(func()) - except ObjectDoesNotExist: + except AttributeError, ObjectDoesNotExist: result_repr = EMPTY_CHANGELIST_VALUE else: # Strip HTML tags in the resulting text, except if the