Ticket #18747: 18747.diff

File 18747.diff, 894 bytes (added by thikonom, 12 years ago)
  • admin_list.py

     
    174174        row_class = ''
    175175        try:
    176176            f, attr, value = lookup_field(field_name, result, cl.model_admin)
    177         except (AttributeError, ObjectDoesNotExist):
     177        except (AttributeError, ObjectDoesNotExist) as e:
     178            if isinstance(e, AttributeError):
     179                if str(e):
     180                    import re
     181                    err_msg = re.match(r'\'([\w]+)\'', str(e))
     182                    if err_msg is not None and not(err_msg.groups()[0]==cl.model._meta.object_name):
     183                    #distinguish between errors raised by the model or any other object
     184                        raise e
    178185            result_repr = EMPTY_CHANGELIST_VALUE
    179186        else:
    180187            if f is None:
Back to Top