Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #7 -- Fixed subtle admin changelist filter bug in maintaining s…

…tate. Thanks for the patch, Manuzhai!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8a9806096fb36c2cd9df623c8d5d0fbc29a08b0d 1 parent 9d8dd86
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/views/admin/main.py
View
2  django/views/admin/main.py
@@ -230,7 +230,7 @@ def change_list(request, app_label, module_name):
elif isinstance(f, meta.DateField):
today = datetime.date.today()
one_week_ago = today - datetime.timedelta(days=7)
- field_generic = '%s__' % field_name
+ field_generic = '%s__' % f.name
filter_template.append('<h3>By %s:</h3><ul>\n' % f.verbose_name)
date_params = dict([(k, v) for k, v in params.items() if k.startswith(field_generic)])
today_str = isinstance(f, meta.DateTimeField) and today.strftime('%Y-%m-%d 23:59:59') or today.strftime('%Y-%m-%d')
Please sign in to comment.
Something went wrong with that request. Please try again.