Refs #3397 -- Corrected the Exception that is caught when ordering by non-fields (added in [4596]), thanks glin@seznam.cz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2007-08-04 14:41:49 +00:00
parent ac027df253
commit 919205ef85
1 changed files with 1 additions and 1 deletions

View File

@ -673,7 +673,7 @@ class ChangeList(object):
try: try:
attr = getattr(lookup_opts.admin.manager.model, field_name) attr = getattr(lookup_opts.admin.manager.model, field_name)
order_field = attr.admin_order_field order_field = attr.admin_order_field
except IndexError: except AttributeError:
pass pass
else: else:
if not isinstance(f.rel, models.ManyToOneRel) or not f.null: if not isinstance(f.rel, models.ManyToOneRel) or not f.null: