Ticket #766: allow_tags_AttributeError.patch

File allow_tags_AttributeError.patch, 872 bytes (added by plisk, 18 years ago)

correct exception handling ?

  • django/contrib/admin/views/main.py

     
    388388                except meta.FieldDoesNotExist:
    389389                    # For non-field list_display values, the value is a method
    390390                    # name. Execute the method.
    391                     func = getattr(result, field_name)
    392391                    try:
     392                        func = getattr(result, field_name)
    393393                        result_repr = str(func())
    394                     except ObjectDoesNotExist:
     394                    except AttributeError:
    395395                        result_repr = EMPTY_CHANGELIST_VALUE
    396396                    else:
    397397                        # Strip HTML tags in the resulting text, except if the
Back to Top