Skip to content
Browse files

Tiny code compression in django.views.admin.main

git-svn-id: http://code.djangoproject.com/svn/django/trunk@290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent a1f479e commit 2d3def9fa29422b2acd2380d84c1d4c0c2e1b331 @adrianholovaty adrianholovaty committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 django/views/admin/main.py
View
3 django/views/admin/main.py
@@ -102,9 +102,8 @@ def change_list(request, app_label, module_name):
order_field, order_type = lookup_opts.pk.name, 'DESC'
if params.has_key(ORDER_VAR):
try:
- order_key = int(params[ORDER_VAR])
try:
- f = lookup_opts.get_field(lookup_opts.admin.list_display[order_key])
+ f = lookup_opts.get_field(lookup_opts.admin.list_display[int(params[ORDER_VAR])])
except meta.FieldDoesNotExist:
pass
else:

0 comments on commit 2d3def9

Please sign in to comment.
Something went wrong with that request. Please try again.